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

Function template make_scope_success

boost::scope::make_scope_success — Creates a scope fail guard with a given action function object.

Synopsis

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


template<typename F> 
  scope_success< typename std::decay< F >::type > 
  make_scope_success(F && func, bool active = true);

Description

Effects: Constructs a scope guard as if by calling scope_success< std::decay_t< F > >(std::forward< F >(func), active).

Parameters:

active

Indicates whether the scope guard should be active upon construction.

func

The callable function object to invoke on destruction.


PrevUpHomeNext