MeshLib
 
Loading...
Searching...
No Matches
MRFinally.h File Reference
#include <utility>

Go to the source code of this file.

Classes

class  MR::detail::ScopeGuard< F >
 
struct  MR::detail::MakeScopeGuard< T >
 

Namespaces

namespace  MR
 
namespace  MR::detail
 

Macros

#define MR_FINALLY   DETAIL_MR_FINALLY( ScopeGuard )
 Usage: MR_FINALLY{...};. Runs the code in braces when exiting the current scope, either normally or via an exception.
 
#define MR_FINALLY_ON_SUCCESS   MR_FINALLY
 When exceptions are disabled, this is equivalent to MR_FINALLY.
 
#define MR_FINALLY_ON_THROW   (void)[&]()
 When exceptions are disabled, this is a noop.
 
#define DETAIL_MR_FINALLY(type_)    auto DETAIL_MR_FINALLY_CAT( _mrScopeGuard, __COUNTER__ ) = ::MR::detail::MakeScopeGuard<::MR::detail::type_>{} ->* [&]() -> void
 
#define DETAIL_MR_FINALLY_CAT(x, y)   DETAIL_MR_FINALLY_CAT_( x, y )
 
#define DETAIL_MR_FINALLY_CAT_(x, y)   x##y
 

Macro Definition Documentation

◆ DETAIL_MR_FINALLY

#define DETAIL_MR_FINALLY ( type_)     auto DETAIL_MR_FINALLY_CAT( _mrScopeGuard, __COUNTER__ ) = ::MR::detail::MakeScopeGuard<::MR::detail::type_>{} ->* [&]() -> void

◆ DETAIL_MR_FINALLY_CAT

#define DETAIL_MR_FINALLY_CAT ( x,
y )   DETAIL_MR_FINALLY_CAT_( x, y )

◆ DETAIL_MR_FINALLY_CAT_

#define DETAIL_MR_FINALLY_CAT_ ( x,
y )   x##y

◆ MR_FINALLY

#define MR_FINALLY   DETAIL_MR_FINALLY( ScopeGuard )

Usage: MR_FINALLY{...};. Runs the code in braces when exiting the current scope, either normally or via an exception.

◆ MR_FINALLY_ON_SUCCESS

#define MR_FINALLY_ON_SUCCESS   MR_FINALLY

When exceptions are disabled, this is equivalent to MR_FINALLY.

◆ MR_FINALLY_ON_THROW

#define MR_FINALLY_ON_THROW   (void)[&]()

When exceptions are disabled, this is a noop.