aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/pipe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pipe.cpp')
-rw-r--r--src/pipe.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pipe.cpp b/src/pipe.cpp
index f809995..299ab0f 100644
--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -12,6 +12,7 @@
#include <windows.h>
#include <cstring>
+#include <utility>
namespace winapi {
namespace {
@@ -43,4 +44,19 @@ Pipe::Pipe() {
create_pipe(m_read_end, m_write_end);
}
+Pipe::Pipe(Pipe&& other) BOOST_NOEXCEPT_OR_NOTHROW {
+ swap(other);
+}
+
+Pipe& Pipe::operator=(Pipe other) BOOST_NOEXCEPT_OR_NOTHROW {
+ swap(other);
+ return *this;
+}
+
+void Pipe::swap(Pipe& other) BOOST_NOEXCEPT_OR_NOTHROW {
+ using std::swap;
+ swap(m_read_end, other.m_read_end);
+ swap(m_write_end, other.m_write_end);
+}
+
} // namespace winapi