Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
chainbase::scope_exit< F > Struct Template Reference

#include <undo_index.hpp>

Public Member Functions

 scope_exit (F &&f)
 
 scope_exit (const scope_exit &)=delete
 
scope_exitoperator= (const scope_exit &)=delete
 
 ~scope_exit ()
 
void cancel ()
 

Detailed Description

template<typename F>
struct chainbase::scope_exit< F >

Definition at line 24 of file undo_index.hpp.

Constructor & Destructor Documentation

◆ scope_exit() [1/2]

template<typename F >
chainbase::scope_exit< F >::scope_exit ( F && f)
inline

Definition at line 26 of file undo_index.hpp.

26: _f(f) {}

◆ scope_exit() [2/2]

template<typename F >
chainbase::scope_exit< F >::scope_exit ( const scope_exit< F > & )
delete

◆ ~scope_exit()

template<typename F >
chainbase::scope_exit< F >::~scope_exit ( )
inline

Definition at line 29 of file undo_index.hpp.

29{ if(!_canceled) _f(); }

Member Function Documentation

◆ cancel()

template<typename F >
void chainbase::scope_exit< F >::cancel ( )
inline

Definition at line 30 of file undo_index.hpp.

30{ _canceled = true; }

◆ operator=()

template<typename F >
scope_exit & chainbase::scope_exit< F >::operator= ( const scope_exit< F > & )
delete

The documentation for this struct was generated from the following file: