From ed91b899f07845baea0d104c7134006c138602a1 Mon Sep 17 00:00:00 2001 From: bmagistro Date: Wed, 14 Sep 2022 16:04:34 -0400 Subject: [PATCH] Resolve noexcept warnings on lambdas (#463) When running with additional warnings enabled, a couple lambdas produce a warning that they should be declared with noexcept. This addresses the lambdas that had been identified while building. Signed-off-by: Ben Magistro --- src/g3log/active.hpp | 2 +- src/g3log/logworker.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g3log/active.hpp b/src/g3log/active.hpp index b04ca3c..c3b9b34 100644 --- a/src/g3log/active.hpp +++ b/src/g3log/active.hpp @@ -48,7 +48,7 @@ namespace kjellkod { public: virtual ~Active() { - send([this] { done_ = true;}); + send([this]() noexcept { done_ = true;}); thd_.join(); } diff --git a/src/g3log/logworker.hpp b/src/g3log/logworker.hpp index 4f925b4..0a46e07 100644 --- a/src/g3log/logworker.hpp +++ b/src/g3log/logworker.hpp @@ -127,7 +127,7 @@ namespace g3 { /// This will clear/remove all the sinks. If a sink shared_ptr was retrieved via the sink /// handle then the sink will be removed internally but will live on in the client's instance void removeAllSinks() { - auto bg_clear_sink_call = [this] { _impl._sinks.clear(); }; + auto bg_clear_sink_call = [this]() noexcept { _impl._sinks.clear(); }; auto token_cleared = g3::spawn_task(bg_clear_sink_call, _impl._bg.get()); token_cleared.wait(); }