MeshLib C++ Docs
Loading...
Searching...
No Matches
MRScopedValue.h File Reference
#include "MRFinally.h"

Go to the source code of this file.

Macros

#define MR_SCOPED_VALUE(var, ...)
 change a variable's value until the current scope's end

Macro Definition Documentation

◆ MR_SCOPED_VALUE

#define MR_SCOPED_VALUE ( var,
... )
Value:
auto MR_CONCAT( _prev_value_, __LINE__ ) = std::move( var ); ( var ) = ( __VA_ARGS__ ); MR_FINALLY { ( var ) = std::move( MR_CONCAT( _prev_value_, __LINE__ ) ); }
#define MR_FINALLY
Usage: MR_FINALLY{...};. Runs the code in braces when exiting the current scope, either normally or v...
Definition MRFinally.h:11
#define MR_CONCAT(a, b)
Concat strings.
Definition MRMacros.h:17

change a variable's value until the current scope's end