Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Macro BOOST_SCOPE_DEFER

BOOST_SCOPE_DEFER — The macro creates a uniquely named defer guard.

Synopsis

// In header: <boost/scope/defer.hpp>

BOOST_SCOPE_DEFER

Description

The macro should be followed by a function object that should be called on leaving the current scope. Usage example:

BOOST_SCOPE_DEFER []
{
    std::cout << "Hello world!" << std::endl;
};
[Note] Note

Using this macro requires C++17.


PrevUpHomeNext