Skip to content

Commit a9153b7

Browse files
Add template deduction guide for scoped_guard (#36)
1 parent c824e3a commit a9153b7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/gtl/utils.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ class scoped_guard {
8585
F unset_;
8686
};
8787

88+
#if __cpp_deduction_guides >= 201703
89+
template<class F>
90+
scoped_guard(F f) -> scoped_guard<F>;
91+
#endif
92+
8893
// ---------------------------------------------------------------------------
8994
// An object which assigns a value to a variable in its constructor, and resets
9095
// the previous its destructor

0 commit comments

Comments
 (0)