diff --git a/library_posix.cpp b/library_posix.cpp index c1aef8eb..876c9a95 100644 --- a/library_posix.cpp +++ b/library_posix.cpp @@ -32,7 +32,7 @@ library_posix::library_posix (const std::experimental::filesystem::path &path): //----------------------------------------------------------------------------- -library_posix::library_posix (library_posix &&rhs): +library_posix::library_posix (library_posix &&rhs) noexcept: m_handle (nullptr) { std::swap (m_handle, rhs.m_handle); diff --git a/library_posix.hpp b/library_posix.hpp index afc87cdc..0c0d04a9 100644 --- a/library_posix.hpp +++ b/library_posix.hpp @@ -26,7 +26,7 @@ namespace util { class library_posix { public: explicit library_posix (const std::experimental::filesystem::path&); - library_posix (library_posix&&); + library_posix (library_posix&&) noexcept; ~library_posix (); library_posix (const library_posix&) = delete; diff --git a/posix/fd.cpp b/posix/fd.cpp index 12322093..f3a7e75e 100644 --- a/posix/fd.cpp +++ b/posix/fd.cpp @@ -38,7 +38,7 @@ fd::fd (const std::experimental::filesystem::path &path, int flags, mode_t mode) /////////////////////////////////////////////////////////////////////////////// -fd::fd (fd &&rhs): +fd::fd (fd &&rhs) noexcept: m_fd (-1) { std::swap (m_fd, rhs.m_fd); @@ -47,7 +47,7 @@ fd::fd (fd &&rhs): //----------------------------------------------------------------------------- fd& -fd::operator= (fd &&rhs) +fd::operator= (fd &&rhs) noexcept { close (); std::swap (m_fd, rhs.m_fd); diff --git a/posix/fd.hpp b/posix/fd.hpp index 7af22996..6991b178 100644 --- a/posix/fd.hpp +++ b/posix/fd.hpp @@ -34,8 +34,8 @@ namespace util::posix { fd (const std::experimental::filesystem::path &path, int flags); fd (const std::experimental::filesystem::path &path, int flags, mode_t); - fd (fd &&); - fd& operator= (fd &&); + fd (fd &&) noexcept; + fd& operator= (fd &&) noexcept; fd& operator= (int); // The int constructor steals the fd. So don't pass in something that diff --git a/posix/map.cpp b/posix/map.cpp index c5da1d11..e1e7c2e0 100644 --- a/posix/map.cpp +++ b/posix/map.cpp @@ -42,7 +42,7 @@ map::map (size_t size, int prot, int flags, const fd &src, off_t offset): //----------------------------------------------------------------------------- -map::map (map &&rhs): +map::map (map &&rhs) noexcept: m_addr (MAP_FAILED), m_size (rhs.m_size) { @@ -63,7 +63,7 @@ map::~map () //----------------------------------------------------------------------------- map& -map::operator= (map &&rhs) +map::operator= (map &&rhs) noexcept { std::swap (m_addr, rhs.m_addr); std::swap (m_size, rhs.m_size); diff --git a/posix/map.hpp b/posix/map.hpp index 33fbd133..30766299 100644 --- a/posix/map.hpp +++ b/posix/map.hpp @@ -27,14 +27,14 @@ namespace util::posix { class map { public: map (const map&) = delete; - map (map&&); + map (map&&) noexcept; map (size_t size, int prot, int flags); map (size_t size, int prot, int flags, const fd&, off_t offset = 0); ~map (); map& operator= (const map&) = delete; - map& operator= (map&&); + map& operator= (map&&) noexcept; uint8_t* begin (void); uint8_t* end (void); diff --git a/posix/socket.cpp b/posix/socket.cpp index c659e82c..490ae52b 100644 --- a/posix/socket.cpp +++ b/posix/socket.cpp @@ -120,14 +120,14 @@ socket::~socket () //----------------------------------------------------------------------------- -socket::socket (socket &&rhs): +socket::socket (socket &&rhs) noexcept: fd (std::move (rhs)) { ; } //----------------------------------------------------------------------------- class socket& -socket::operator= (socket &&rhs) +socket::operator= (socket &&rhs) noexcept { fd::operator= (std::move (rhs)); return *this; diff --git a/posix/socket.hpp b/posix/socket.hpp index 289d112e..2becd571 100644 --- a/posix/socket.hpp +++ b/posix/socket.hpp @@ -38,8 +38,8 @@ namespace util::posix { socket (const socket&) = delete; socket& operator= (const socket&) = delete; - socket (socket &&rhs); - socket& operator= (socket &&); + socket (socket &&rhs) noexcept; + socket& operator= (socket &&) noexcept; // the destructor is provided so that we can operate more cleanly on // win32 where we must call closesocket instead of the normal close. diff --git a/thread/spinlock.cpp b/thread/spinlock.cpp index 71c88540..8e9b2451 100644 --- a/thread/spinlock.cpp +++ b/thread/spinlock.cpp @@ -28,7 +28,7 @@ spinlock::spinlock (): //----------------------------------------------------------------------------- -spinlock::spinlock (spinlock &&rhs): +spinlock::spinlock (spinlock &&rhs) noexcept: held (rhs.held.load ()) { ; } diff --git a/thread/spinlock.hpp b/thread/spinlock.hpp index 8c301cd7..702ccff5 100644 --- a/thread/spinlock.hpp +++ b/thread/spinlock.hpp @@ -30,8 +30,8 @@ namespace util::thread { class spinlock { public: spinlock (); - spinlock (spinlock &&); - spinlock& operator= (spinlock &&); + spinlock (spinlock &&) noexcept; + spinlock& operator= (spinlock &&) noexcept; spinlock (const spinlock&) = delete; spinlock& operator= (const spinlock&) = delete;