diff options
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 |