MeshLib Documentation
Loading...
Searching...
No Matches
MRFinally.h File Reference
#include "MRMacros.h"
#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 MR_CONCAT( _mrScopeGuard, __COUNTER__ ) = ::MR::detail::MakeScopeGuard<::MR::detail::type_>{} ->* [&]() -> void
 

Macro Definition Documentation

◆ DETAIL_MR_FINALLY

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

◆ 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.