aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-06-25 19:16:25 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-06-25 19:59:34 +0300
commit8ae25c7b5890aefd9dad96c1d700e5a1768fb638 (patch)
treedcce1135460f8bbe3eaf265f6cd8a068f524af4b
parentREADME update (diff)
downloadprivilege-check-8ae25c7b5890aefd9dad96c1d700e5a1768fb638.tar.gz
privilege-check-8ae25c7b5890aefd9dad96c1d700e5a1768fb638.zip
code style
Diffstat (limited to '')
-rw-r--r--src/handle.hpp6
-rw-r--r--src/string.hpp14
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 <typename Char, typename String>
struct StringHelper<Char, String, typename std::enable_if<std::is_same<typename std::decay<typename std::remove_pointer<String>::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<Char>::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 <typename Char, typename String>
struct StringHelper<Char, String, typename std::enable_if<std::is_same<String, std::basic_string<Char>>::value>::type>
{
- inline StringHelper(const std::basic_string<Char>& s)
+ StringHelper(const std::basic_string<Char>& 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<Char>& s;