• Eugene Kosov's avatar
    MDEV-22438 add a function similar to std::make_scope_exit() · ccc4eb85
    Eugene Kosov authored
    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.
    ccc4eb85
scope.h 1.57 KB