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/process_io.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 '')
-rw-r--r-- | include/winapi/process_io.hpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/include/winapi/process_io.hpp b/include/winapi/process_io.hpp index 512cb7b..976ad6e 100644 --- a/include/winapi/process_io.hpp +++ b/include/winapi/process_io.hpp @@ -20,16 +20,18 @@ namespace process { struct Stream { Stream(Handle&& handle) : handle{std::move(handle)} {} - Handle handle; - // VS 2013 won't generate these automatically. Stream(Stream&& other) BOOST_NOEXCEPT_OR_NOTHROW; Stream& operator=(Stream other) BOOST_NOEXCEPT_OR_NOTHROW; void swap(Stream& other) BOOST_NOEXCEPT_OR_NOTHROW; Stream(const Stream&) = delete; + + Handle handle; }; -void swap(Stream& a, Stream& b) BOOST_NOEXCEPT_OR_NOTHROW; +inline void swap(Stream& a, Stream& b) BOOST_NOEXCEPT_OR_NOTHROW { + a.swap(b); +} struct Stdin : Stream { Stdin(); @@ -70,20 +72,22 @@ struct Stderr : Stream { struct IO { IO() = default; - void close(); - - Stdin std_in; - Stdout std_out; - Stderr std_err; - // VS 2013 won't generate these automatically. IO(IO&& other) BOOST_NOEXCEPT_OR_NOTHROW; IO& operator=(IO other) BOOST_NOEXCEPT_OR_NOTHROW; void swap(IO& other) BOOST_NOEXCEPT_OR_NOTHROW; IO(const IO&) = delete; + + void close(); + + Stdin std_in; + Stdout std_out; + Stderr std_err; }; -void swap(IO& a, IO& b) BOOST_NOEXCEPT_OR_NOTHROW; +inline void swap(IO& a, IO& b) BOOST_NOEXCEPT_OR_NOTHROW { + a.swap(b); +} } // namespace process } // namespace winapi |