From: Joel Rosdahl Date: Mon, 27 Apr 2020 14:39:02 +0000 (+0200) Subject: Add noexcept to Args move constructor/operator= X-Git-Tag: v4.0~524 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e65cc002564bb79c4373457c338cb81bd2f0d1ca;p=thirdparty%2Fccache.git Add noexcept to Args move constructor/operator= As suggested by clang-tidy. --- diff --git a/src/Args.cpp b/src/Args.cpp index d1240995e..39cba545d 100644 --- a/src/Args.cpp +++ b/src/Args.cpp @@ -28,7 +28,8 @@ Args::Args(const Args& other) : m_args(other.m_args), argv(m_args) { } -Args::Args(Args&& other) : m_args(std::move(other.m_args)), argv(m_args) +Args::Args(Args&& other) noexcept + : m_args(std::move(other.m_args)), argv(m_args) { } @@ -134,7 +135,7 @@ Args::operator=(const Args& other) } Args& -Args::operator=(Args&& other) +Args::operator=(Args&& other) noexcept { m_args = std::move(other.m_args); argv.m_args = &m_args; diff --git a/src/Args.hpp b/src/Args.hpp index 7642a289d..ab1a91f38 100644 --- a/src/Args.hpp +++ b/src/Args.hpp @@ -34,14 +34,14 @@ class Args public: Args(); Args(const Args& other); - Args(Args&& other); + Args(Args&& other) noexcept; static Args from_argv(int argc, const char* const* argv); static Args from_string(const std::string& command); static nonstd::optional from_gcc_atfile(const std::string& filename); Args& operator=(const Args& other); - Args& operator=(Args&& other); + Args& operator=(Args&& other) noexcept; bool operator==(const Args& other) const; bool operator!=(const Args& other) const;