The Battle for Wesnoth  1.19.0-dev
Classes | Namespaces | Macros
scope_exit.hpp File Reference
#include <functional>
#include <boost/preprocessor/cat.hpp>
Include dependency graph for scope_exit.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  utils::scope_exit< F >
 
struct  utils::scope_exit_syntax_support
 

Namespaces

 utils
 

Macros

#define ON_SCOPE_EXIT(...)   [[maybe_unused]] const auto& BOOST_PP_CAT(scope_exit, __LINE__) = utils::scope_exit_syntax_support() << [__VA_ARGS__]()
 Run some arbitrary code (a lambda) when the current scope exits The lambda body follows this header, terminated by a semicolon. More...
 

Macro Definition Documentation

◆ ON_SCOPE_EXIT

#define ON_SCOPE_EXIT (   ...)    [[maybe_unused]] const auto& BOOST_PP_CAT(scope_exit, __LINE__) = utils::scope_exit_syntax_support() << [__VA_ARGS__]()

Run some arbitrary code (a lambda) when the current scope exits The lambda body follows this header, terminated by a semicolon.

  • ... Capture clause for the lambda.

Definition at line 43 of file scope_exit.hpp.