aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/pipe.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-10-27 13:17:26 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-10-27 13:18:45 +0300
commit0c62070b24273e565cce112ab061df6665d3ae8c (patch)
treea9a36ef593871daef57986fbfbbfb44de8c1116d /src/pipe.cpp
parentBoost.Test is broken in 1.62 (diff)
downloadwinapi-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 '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