rcpputils  master
C++ API providing common utilities and data structures.
Classes | Namespaces | Macros | Functions
scope_exit.hpp File Reference
#include <utility>
#include "rcutils/macros.h"
Include dependency graph for scope_exit.hpp:

Go to the source code of this file.

Classes

struct  rcpputils::scope_exit< CallableT >
 

Namespaces

 rcpputils
 

Macros

#define RCPPUTILS_SCOPE_EXIT(code)   auto RCUTILS_JOIN(scope_exit_, __LINE__) = rcpputils::make_scope_exit([&]() {code;})
 

Functions

template<typename CallableT >
scope_exit< CallableT > rcpputils::make_scope_exit (CallableT &&callable)
 

Macro Definition Documentation

◆ RCPPUTILS_SCOPE_EXIT

#define RCPPUTILS_SCOPE_EXIT (   code)    auto RCUTILS_JOIN(scope_exit_, __LINE__) = rcpputils::make_scope_exit([&]() {code;})