From 70b451db7b457f505f4aa03c08cfd9302931d5f0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 22 May 2023 14:43:36 +0200 Subject: [PATCH] util/ScopeExit: add `noexcept` --- src/util/ScopeExit.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/ScopeExit.hxx b/src/util/ScopeExit.hxx index 0fecf6c1e..8dc0e2c70 100644 --- a/src/util/ScopeExit.hxx +++ b/src/util/ScopeExit.hxx @@ -40,9 +40,9 @@ class ScopeExitGuard : F { bool enabled = true; public: - explicit ScopeExitGuard(F &&f):F(std::forward(f)) {} + explicit ScopeExitGuard(F &&f) noexcept:F(std::forward(f)) {} - ScopeExitGuard(ScopeExitGuard &&src) + ScopeExitGuard(ScopeExitGuard &&src) noexcept :F(std::move(src)), enabled(src.enabled) { src.enabled = false; } @@ -68,7 +68,7 @@ struct ScopeExitTag { parantheses at the end of the expression AtScopeExit() call */ template - ScopeExitGuard operator+(F &&f) { + ScopeExitGuard operator+(F &&f) noexcept { return ScopeExitGuard(std::forward(f)); } };