MeshLib C++ Docs
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
 only for bindings generation
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
 If no exceptions.
#define MR_FINALLY_ON_THROW   (void)[&]()
 When exceptions are disabled, this is a noop.
#define DETAIL_MR_FINALLY(type_)
 If no exceptions.

Macro Definition Documentation

◆ DETAIL_MR_FINALLY

#define DETAIL_MR_FINALLY ( type_)
Value:
auto MR_CONCAT( _mrScopeGuard, __COUNTER__ ) = ::MR::detail::MakeScopeGuard<::MR::detail::type_>{} ->* [&]() -> void
#define MR_CONCAT(a, b)
Concat strings.
Definition MRMacros.h:17
Definition MRFinally.h:73

If no exceptions.

◆ 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

If no exceptions.

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.