From 0c62070b24273e565cce112ab061df6665d3ae8c Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 27 Oct 2020 13:17:26 +0300 Subject: code style Don't use brace initialization in constructors, VS 2013 doesn't like that. --- src/pipe.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/pipe.cpp') 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 #include +#include 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 -- cgit v1.2.3