MDEV-22438 add a function similar to std::make_scope_exit()
The idea was borrowed from http://wg21.link/p0052 scope_exit class is a helper, its name is hidden from user in the namespace detail. Alternative implementation of scope_exit with std::function looks slower on goldbolt.org as it may require allocation, etc. scope_exit doesn't need to own a callable, so beeing a pointer is enough. And std::decay produces such a pointer from callable.
Showing
include/scope.h
0 → 100644
Please register or sign in to comment