diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-10-27 13:17:26 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-10-27 13:18:45 +0300 |
commit | 0c62070b24273e565cce112ab061df6665d3ae8c (patch) | |
tree | a9a36ef593871daef57986fbfbbfb44de8c1116d /include/winapi/pipe.hpp | |
parent | Boost.Test is broken in 1.62 (diff) | |
download | winapi-common-0c62070b24273e565cce112ab061df6665d3ae8c.tar.gz winapi-common-0c62070b24273e565cce112ab061df6665d3ae8c.zip |
code style
Don't use brace initialization in constructors, VS 2013 doesn't like
that.
Diffstat (limited to 'include/winapi/pipe.hpp')
-rw-r--r-- | include/winapi/pipe.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/winapi/pipe.hpp b/include/winapi/pipe.hpp index ebd99e8..9f71858 100644 --- a/include/winapi/pipe.hpp +++ b/include/winapi/pipe.hpp @@ -7,12 +7,22 @@ #include "handle.hpp" +#include <boost/config.hpp> + +#include <utility> + namespace winapi { class Pipe { public: Pipe(); + // VS 2013 won't generate these automatically. + Pipe(Pipe&&) BOOST_NOEXCEPT_OR_NOTHROW; + Pipe& operator=(Pipe) BOOST_NOEXCEPT_OR_NOTHROW; + void swap(Pipe&) BOOST_NOEXCEPT_OR_NOTHROW; + Pipe(const Pipe&) = delete; + Handle& read_end() { return m_read_end; } const Handle& read_end() const { return m_read_end; } Handle& write_end() { return m_write_end; } @@ -23,4 +33,17 @@ private: Handle m_write_end; }; +inline void swap(Pipe& a, Pipe& b) BOOST_NOEXCEPT_OR_NOTHROW { + a.swap(b); +} + } // namespace winapi + +namespace std { + +template <> +inline void swap(winapi::Pipe& a, winapi::Pipe& b) BOOST_NOEXCEPT_OR_NOTHROW { + a.swap(b); +} + +} // namespace std |