Commit 70b451db authored by Max Kellermann's avatar Max Kellermann

util/ScopeExit: add `noexcept`

parent 2ab03a09
...@@ -40,9 +40,9 @@ class ScopeExitGuard : F { ...@@ -40,9 +40,9 @@ class ScopeExitGuard : F {
bool enabled = true; bool enabled = true;
public: public:
explicit ScopeExitGuard(F &&f):F(std::forward<F>(f)) {} explicit ScopeExitGuard(F &&f) noexcept:F(std::forward<F>(f)) {}
ScopeExitGuard(ScopeExitGuard &&src) ScopeExitGuard(ScopeExitGuard &&src) noexcept
:F(std::move(src)), enabled(src.enabled) { :F(std::move(src)), enabled(src.enabled) {
src.enabled = false; src.enabled = false;
} }
...@@ -68,7 +68,7 @@ struct ScopeExitTag { ...@@ -68,7 +68,7 @@ struct ScopeExitTag {
parantheses at the end of the expression AtScopeExit() parantheses at the end of the expression AtScopeExit()
call */ call */
template<typename F> template<typename F>
ScopeExitGuard<F> operator+(F &&f) { ScopeExitGuard<F> operator+(F &&f) noexcept {
return ScopeExitGuard<F>(std::forward<F>(f)); return ScopeExitGuard<F>(std::forward<F>(f));
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment