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.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 'include/winapi/process.hpp')
-rw-r--r-- | include/winapi/process.hpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/include/winapi/process.hpp b/include/winapi/process.hpp index 3c9a840..db5f5d1 100644 --- a/include/winapi/process.hpp +++ b/include/winapi/process.hpp @@ -27,7 +27,7 @@ struct ProcessParameters { ConsoleNew, }; - explicit ProcessParameters(const CommandLine& cmd_line) : cmd_line{cmd_line} {} + explicit ProcessParameters(const CommandLine& cmd_line) : cmd_line(cmd_line) {} // VS 2013 won't generate these automatically. ProcessParameters(ProcessParameters&&) BOOST_NOEXCEPT_OR_NOTHROW; @@ -40,17 +40,19 @@ struct ProcessParameters { ConsoleCreationMode console_mode = ConsoleNew; }; -void swap(ProcessParameters&, ProcessParameters&) BOOST_NOEXCEPT_OR_NOTHROW; +inline void swap(ProcessParameters& a, ProcessParameters& b) BOOST_NOEXCEPT_OR_NOTHROW { + a.swap(b); +} struct ShellParameters : ProcessParameters { - explicit ShellParameters(const CommandLine& cmd_line) : ProcessParameters{cmd_line} {} - static ShellParameters runas(const CommandLine& cmd_line) { ShellParameters params{cmd_line}; params.verb = "runas"; return params; } + explicit ShellParameters(const CommandLine& cmd_line) : ProcessParameters(cmd_line) {} + // VS 2013 won't generate these automatically. ShellParameters(ShellParameters&&) BOOST_NOEXCEPT_OR_NOTHROW; ShellParameters& operator=(ShellParameters) BOOST_NOEXCEPT_OR_NOTHROW; @@ -60,7 +62,9 @@ struct ShellParameters : ProcessParameters { boost::optional<std::string> verb; }; -void swap(ShellParameters&, ShellParameters&) BOOST_NOEXCEPT_OR_NOTHROW; +inline void swap(ShellParameters& a, ShellParameters& b) BOOST_NOEXCEPT_OR_NOTHROW { + a.swap(b); +} class Process { public: @@ -89,14 +93,16 @@ public: static std::string get_resource_string(unsigned int id); private: - explicit Process(Handle&& handle) : m_handle{std::move(handle)} {} + explicit Process(Handle&& handle) : m_handle(std::move(handle)) {} static HMODULE get_exe_module(); Handle m_handle; }; -void swap(Process& a, Process& b) BOOST_NOEXCEPT_OR_NOTHROW; +inline void swap(Process& a, Process& b) BOOST_NOEXCEPT_OR_NOTHROW { + a.swap(b); +} } // namespace winapi |