From 5bfcf280a5b5002f72c6c3c969ac1b12479434f8 Mon Sep 17 00:00:00 2001 From: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com> Date: Thu, 20 Feb 2025 22:04:07 -0600 Subject: [PATCH] Fix scope_guard forwarding --- src/utils/utils.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/utils.hpp b/src/utils/utils.hpp index faf576b..fead205 100644 --- a/src/utils/utils.hpp +++ b/src/utils/utils.hpp @@ -283,7 +283,8 @@ namespace detail { F f; bool active; public: - scope_guard(F&& f) : f(std::forward(f)), active(true) {} + template + scope_guard(G&& f) : f(std::forward(f)), active(true) {} ~scope_guard() { if(active) { f();