fix(scope_exit): move, don't forward

This commit is contained in:
Marcus Holland-Moritz 2024-10-21 00:51:58 +02:00
parent c68820d40f
commit 328abe1303

View File

@ -29,7 +29,7 @@ template <typename F>
class scope_exit {
public:
explicit scope_exit(F&& f)
: f_{std::forward<F>(f)} {}
: f_{std::move(f)} {}
~scope_exit() { f_(); }
private: