Fix scope_guard forwarding
This commit is contained in:
parent
9b02fc6f74
commit
5bfcf280a5
@ -283,7 +283,8 @@ namespace detail {
|
|||||||
F f;
|
F f;
|
||||||
bool active;
|
bool active;
|
||||||
public:
|
public:
|
||||||
scope_guard(F&& f) : f(std::forward<F>(f)), active(true) {}
|
template<typename G>
|
||||||
|
scope_guard(G&& f) : f(std::forward<F>(f)), active(true) {}
|
||||||
~scope_guard() {
|
~scope_guard() {
|
||||||
if(active) {
|
if(active) {
|
||||||
f();
|
f();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user