aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/winapi/buffer.hpp4
-rw-r--r--include/winapi/cmd_line.hpp8
-rw-r--r--include/winapi/error.hpp4
-rw-r--r--include/winapi/file.hpp2
-rw-r--r--include/winapi/handle.hpp22
-rw-r--r--include/winapi/pipe.hpp21
-rw-r--r--include/winapi/process.hpp55
-rw-r--r--include/winapi/process_io.hpp51
-rw-r--r--include/winapi/resource.hpp2
-rw-r--r--include/winapi/shmem.hpp45
-rw-r--r--include/winapi/sid.hpp4
11 files changed, 15 insertions, 203 deletions
diff --git a/include/winapi/buffer.hpp b/include/winapi/buffer.hpp
index 08094f8..4d47930 100644
--- a/include/winapi/buffer.hpp
+++ b/include/winapi/buffer.hpp
@@ -22,9 +22,9 @@ public:
Buffer() = default;
- Buffer(std::initializer_list<unsigned char> lst) : Parent(lst) {}
+ Buffer(std::initializer_list<unsigned char> lst) : Parent{lst} {}
- explicit Buffer(Parent&& src) : Parent(std::move(src)) {}
+ explicit Buffer(Parent&& src) : Parent{std::move(src)} {}
template <typename CharT>
explicit Buffer(const std::basic_string<CharT>& src) {
diff --git a/include/winapi/cmd_line.hpp b/include/winapi/cmd_line.hpp
index 8ea1a92..d635350 100644
--- a/include/winapi/cmd_line.hpp
+++ b/include/winapi/cmd_line.hpp
@@ -5,8 +5,6 @@
#pragma once
-#include <boost/config.hpp>
-
#include <string>
#include <utility>
#include <vector>
@@ -24,10 +22,10 @@ public:
CommandLine() = default;
explicit CommandLine(const std::string& argv0, const std::vector<std::string>& args = {})
- : m_argv0(argv0), m_args(args) {}
+ : m_argv0{argv0}, m_args{args} {}
explicit CommandLine(std::string&& argv0, std::vector<std::string>&& args = {})
- : m_argv0(std::move(argv0)), m_args(std::move(args)) {}
+ : m_argv0{std::move(argv0)}, m_args{std::move(args)} {}
explicit CommandLine(const std::vector<std::string>& argv);
@@ -50,7 +48,7 @@ public:
std::vector<std::string> get_argv() const;
private:
- static BOOST_CONSTEXPR char token_sep() { return ' '; }
+ static constexpr char token_sep() { return ' '; }
std::string escape_argv0() const { return escape(get_argv0()); }
diff --git a/include/winapi/error.hpp b/include/winapi/error.hpp
index a14d333..8ecd720 100644
--- a/include/winapi/error.hpp
+++ b/include/winapi/error.hpp
@@ -5,8 +5,6 @@
#pragma once
-#include <boost/config.hpp>
-
#include <windows.h>
#include <cstdint>
@@ -22,7 +20,7 @@ class CategoryWindows : public std::error_category {
public:
CategoryWindows() = default;
- const char* name() const BOOST_NOEXCEPT_OR_NOTHROW { return "Windows"; }
+ const char* name() const noexcept { return "Windows"; }
std::string message(int32_t) const;
};
diff --git a/include/winapi/file.hpp b/include/winapi/file.hpp
index e9f8510..7d0126c 100644
--- a/include/winapi/file.hpp
+++ b/include/winapi/file.hpp
@@ -42,7 +42,7 @@ public:
static void remove(const std::string&);
static void remove(const CanonicalPath&);
- explicit File(Handle&& handle) : Handle(std::move(handle)) {}
+ explicit File(Handle&& handle) : Handle{std::move(handle)} {}
std::size_t get_size() const;
diff --git a/include/winapi/handle.hpp b/include/winapi/handle.hpp
index 1145fd6..8ea90aa 100644
--- a/include/winapi/handle.hpp
+++ b/include/winapi/handle.hpp
@@ -7,8 +7,6 @@
#include "buffer.hpp"
-#include <boost/config.hpp>
-
#include <windows.h>
#include <cstddef>
@@ -23,11 +21,6 @@ public:
Handle() = default;
explicit Handle(HANDLE);
- Handle(Handle&& other) BOOST_NOEXCEPT_OR_NOTHROW;
- Handle& operator=(Handle other) BOOST_NOEXCEPT_OR_NOTHROW;
- void swap(Handle& other) BOOST_NOEXCEPT_OR_NOTHROW;
- Handle(const Handle&) = delete;
-
HANDLE get() const { return m_impl.get(); }
HANDLE ptr() const { return get(); }
@@ -45,7 +38,7 @@ public:
Buffer read() const;
- BOOST_STATIC_CONSTEXPR std::size_t max_chunk_size = 16 * 1024;
+ static constexpr std::size_t max_chunk_size = 16 * 1024;
bool read_chunk(Buffer& read_chunk) const;
void write(const void*, std::size_t nb) const;
@@ -67,17 +60,4 @@ private:
std::unique_ptr<void, Close> m_impl;
};
-inline void swap(Handle& a, Handle& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
} // namespace winapi
-
-namespace std {
-
-template <>
-inline void swap(winapi::Handle& a, winapi::Handle& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
-} // namespace std
diff --git a/include/winapi/pipe.hpp b/include/winapi/pipe.hpp
index 9f71858..aec87cd 100644
--- a/include/winapi/pipe.hpp
+++ b/include/winapi/pipe.hpp
@@ -7,8 +7,6 @@
#include "handle.hpp"
-#include <boost/config.hpp>
-
#include <utility>
namespace winapi {
@@ -17,12 +15,6 @@ class Pipe {
public:
Pipe();
- // VS 2013 won't generate these automatically.
- Pipe(Pipe&&) BOOST_NOEXCEPT_OR_NOTHROW;
- Pipe& operator=(Pipe) BOOST_NOEXCEPT_OR_NOTHROW;
- void swap(Pipe&) BOOST_NOEXCEPT_OR_NOTHROW;
- Pipe(const Pipe&) = delete;
-
Handle& read_end() { return m_read_end; }
const Handle& read_end() const { return m_read_end; }
Handle& write_end() { return m_write_end; }
@@ -33,17 +25,4 @@ private:
Handle m_write_end;
};
-inline void swap(Pipe& a, Pipe& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
} // namespace winapi
-
-namespace std {
-
-template <>
-inline void swap(winapi::Pipe& a, winapi::Pipe& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
-} // namespace std
diff --git a/include/winapi/process.hpp b/include/winapi/process.hpp
index b79d7c2..d5a4ed5 100644
--- a/include/winapi/process.hpp
+++ b/include/winapi/process.hpp
@@ -10,7 +10,6 @@
#include "process_io.hpp"
#include "resource.hpp"
-#include <boost/config.hpp>
#include <boost/optional.hpp>
#include <windows.h>
@@ -28,23 +27,13 @@ struct ProcessParameters {
ConsoleNew,
};
- explicit ProcessParameters(const CommandLine& cmd_line) : cmd_line(cmd_line) {}
-
- // VS 2013 won't generate these automatically.
- ProcessParameters(ProcessParameters&&) BOOST_NOEXCEPT_OR_NOTHROW;
- ProcessParameters& operator=(ProcessParameters) BOOST_NOEXCEPT_OR_NOTHROW;
- void swap(ProcessParameters& other) BOOST_NOEXCEPT_OR_NOTHROW;
- ProcessParameters(const ProcessParameters&) = delete;
+ explicit ProcessParameters(const CommandLine& cmd_line) : cmd_line{cmd_line} {}
CommandLine cmd_line;
boost::optional<process::IO> io;
ConsoleCreationMode console_mode = ConsoleNew;
};
-inline void swap(ProcessParameters& a, ProcessParameters& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
struct ShellParameters : ProcessParameters {
static ShellParameters runas(const CommandLine& cmd_line) {
ShellParameters params{cmd_line};
@@ -52,21 +41,11 @@ struct ShellParameters : ProcessParameters {
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;
- void swap(ShellParameters& other) BOOST_NOEXCEPT_OR_NOTHROW;
- ShellParameters(const ShellParameters&) = delete;
+ explicit ShellParameters(const CommandLine& cmd_line) : ProcessParameters{cmd_line} {}
boost::optional<std::string> verb;
};
-inline void swap(ShellParameters& a, ShellParameters& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
class Process {
public:
using ID = DWORD;
@@ -85,12 +64,6 @@ public:
static DWORD default_permissions();
static DWORD read_permissions();
- // VS 2013 won't generate these automatically.
- Process(Process&&) BOOST_NOEXCEPT_OR_NOTHROW;
- Process& operator=(Process) BOOST_NOEXCEPT_OR_NOTHROW;
- void swap(Process& other) BOOST_NOEXCEPT_OR_NOTHROW;
- Process(const Process&) = delete;
-
ID get_id() const { return m_id; }
const Handle& get_handle() const { return m_handle; }
@@ -115,28 +88,4 @@ private:
Handle m_handle;
};
-inline void swap(Process& a, Process& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
} // namespace winapi
-
-namespace std {
-
-template <>
-inline void swap(winapi::ProcessParameters& a,
- winapi::ProcessParameters& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
-template <>
-inline void swap(winapi::ShellParameters& a, winapi::ShellParameters& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
-template <>
-inline void swap(winapi::Process& a, winapi::Process& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
-} // namespace std
diff --git a/include/winapi/process_io.hpp b/include/winapi/process_io.hpp
index 976ad6e..805ada8 100644
--- a/include/winapi/process_io.hpp
+++ b/include/winapi/process_io.hpp
@@ -9,8 +9,6 @@
#include "path.hpp"
#include "pipe.hpp"
-#include <boost/config.hpp>
-
#include <string>
#include <utility>
@@ -20,29 +18,14 @@ namespace process {
struct Stream {
Stream(Handle&& handle) : handle{std::move(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;
};
-inline void swap(Stream& a, Stream& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
struct Stdin : Stream {
Stdin();
explicit Stdin(const std::string& file);
explicit Stdin(const CanonicalPath& file);
explicit Stdin(Pipe&);
-
- // VS 2013 won't generate these automatically.
- Stdin(Stdin&& other) BOOST_NOEXCEPT_OR_NOTHROW;
- Stdin& operator=(Stdin other) BOOST_NOEXCEPT_OR_NOTHROW;
- Stdin(const Stdin&) = delete;
};
struct Stdout : Stream {
@@ -50,11 +33,6 @@ struct Stdout : Stream {
explicit Stdout(const std::string& file);
explicit Stdout(const CanonicalPath& file);
explicit Stdout(Pipe&);
-
- // VS 2013 won't generate these automatically.
- Stdout(Stdout&& other) BOOST_NOEXCEPT_OR_NOTHROW;
- Stdout& operator=(Stdout other) BOOST_NOEXCEPT_OR_NOTHROW;
- Stdout(const Stdout&) = delete;
};
struct Stderr : Stream {
@@ -62,22 +40,11 @@ struct Stderr : Stream {
explicit Stderr(const std::string& file);
explicit Stderr(const CanonicalPath& file);
explicit Stderr(Pipe&);
-
- // VS 2013 won't generate these automatically.
- Stderr(Stderr&& other) BOOST_NOEXCEPT_OR_NOTHROW;
- Stderr& operator=(Stderr other) BOOST_NOEXCEPT_OR_NOTHROW;
- Stderr(const Stderr&) = delete;
};
struct IO {
IO() = default;
- // 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;
@@ -85,23 +52,5 @@ struct IO {
Stderr std_err;
};
-inline void swap(IO& a, IO& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
} // namespace process
} // namespace winapi
-
-namespace std {
-
-template <>
-inline void swap(winapi::process::Stream& a, winapi::process::Stream& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
-template <>
-inline void swap(winapi::process::IO& a, winapi::process::IO& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
-} // namespace std
diff --git a/include/winapi/resource.hpp b/include/winapi/resource.hpp
index 3fda73e..2f77d3e 100644
--- a/include/winapi/resource.hpp
+++ b/include/winapi/resource.hpp
@@ -16,7 +16,7 @@ struct Resource {
Resource() = default;
- Resource(const void* data, std::size_t nb) : data(data), nb(nb) {}
+ Resource(const void* data, std::size_t nb) : data{data}, nb{nb} {}
Buffer copy() const { return {data, nb}; }
diff --git a/include/winapi/shmem.hpp b/include/winapi/shmem.hpp
index f2ce33e..4fc5ac7 100644
--- a/include/winapi/shmem.hpp
+++ b/include/winapi/shmem.hpp
@@ -7,8 +7,6 @@
#include "handle.hpp"
-#include <boost/config.hpp>
-
#include <cstddef>
#include <memory>
#include <string>
@@ -22,12 +20,6 @@ public:
static SharedMemory create(const std::string& name, std::size_t nb);
static SharedMemory open(const std::string& name);
- // VS 2013 won't generate these automatically:
- SharedMemory(SharedMemory&&) BOOST_NOEXCEPT_OR_NOTHROW;
- SharedMemory& operator=(SharedMemory) BOOST_NOEXCEPT_OR_NOTHROW;
- void swap(SharedMemory&) BOOST_NOEXCEPT_OR_NOTHROW;
- SharedMemory(const SharedMemory&) = delete;
-
void* get() const { return m_addr.get(); }
void* ptr() const { return get(); }
@@ -38,16 +30,12 @@ private:
SharedMemory() = default;
- SharedMemory(Handle&& handle, void* addr) : m_handle(std::move(handle)), m_addr(addr) {}
+ SharedMemory(Handle&& handle, void* addr) : m_handle{std::move(handle)}, m_addr{addr} {}
Handle m_handle;
std::unique_ptr<void, Unmap> m_addr;
};
-inline void swap(SharedMemory& a, SharedMemory& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
template <typename T>
class SharedObject {
public:
@@ -66,21 +54,8 @@ public:
return obj;
}
- SharedObject(SharedObject&& other) BOOST_NOEXCEPT_OR_NOTHROW
- : m_shmem(std::move(other.m_shmem)),
- m_destruct(other.m_destruct) {}
-
- SharedObject& operator=(SharedObject other) BOOST_NOEXCEPT_OR_NOTHROW {
- swap(other);
- return *this;
- }
-
- void swap(SharedObject& other) BOOST_NOEXCEPT_OR_NOTHROW {
- using std::swap;
- swap(m_shmem, other.m_shmem);
- swap(m_destruct, other.m_destruct);
- }
-
+ SharedObject(SharedObject&& other) noexcept = default;
+ SharedObject& operator=(const SharedObject& other) noexcept = default;
SharedObject(const SharedObject&) = delete;
~SharedObject() {
@@ -103,18 +78,4 @@ private:
bool m_destruct = false;
};
-template <typename T>
-inline void swap(SharedObject<T>& a, SharedObject<T>& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
} // namespace winapi
-
-namespace std {
-
-template <>
-inline void swap(winapi::SharedMemory& a, winapi::SharedMemory& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
-} // namespace std
diff --git a/include/winapi/sid.hpp b/include/winapi/sid.hpp
index f418b89..5a7c759 100644
--- a/include/winapi/sid.hpp
+++ b/include/winapi/sid.hpp
@@ -7,8 +7,6 @@
#include "buffer.hpp"
-#include <boost/config.hpp>
-
#include <windows.h>
#include <cstddef>
@@ -18,7 +16,7 @@ namespace winapi {
class Sid {
public:
- BOOST_STATIC_CONSTEXPR std::size_t MAX_SID_SIZE = SECURITY_MAX_SID_SIZE;
+ static constexpr std::size_t MAX_SID_SIZE = SECURITY_MAX_SID_SIZE;
typedef SID Impl;