From 8ae25c7b5890aefd9dad96c1d700e5a1768fb638 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 25 Jun 2017 19:16:25 +0300 Subject: code style --- src/handle.hpp | 6 ++++++ src/string.hpp | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/handle.hpp b/src/handle.hpp index 282e35d..99b5292 100644 --- a/src/handle.hpp +++ b/src/handle.hpp @@ -61,8 +61,14 @@ private: Handle(const Handle&) = delete; }; +inline void swap(Handle& a, Handle& b) noexcept +{ + a.swap(b); +} + namespace std { + template <> inline void swap(Handle& a, Handle& b) noexcept { a.swap(b); diff --git a/src/string.hpp b/src/string.hpp index 52ed518..24d0425 100644 --- a/src/string.hpp +++ b/src/string.hpp @@ -77,19 +77,19 @@ namespace string template struct StringHelper::type>::type, Char>::value>::type> { - inline StringHelper(const Char& c) + StringHelper(const Char& c) : buf{&c} , len{1} { } - inline StringHelper(const Char* s) + StringHelper(const Char* s) : buf{s} , len{std::char_traits::length(s)} { } - inline const Char* buffer() const { return buf; } + const Char* buffer() const { return buf; } - inline std::size_t length() const { return len; } + std::size_t length() const { return len; } private: const Char* const buf; @@ -99,13 +99,13 @@ namespace string template struct StringHelper>::value>::type> { - inline StringHelper(const std::basic_string& s) + StringHelper(const std::basic_string& s) : s{s} { } - inline const Char* buffer() const { return s.c_str(); } + const Char* buffer() const { return s.c_str(); } - inline std::size_t length() const { return s.length(); } + std::size_t length() const { return s.length(); } private: const std::basic_string& s; -- cgit v1.2.3