MeshLib Documentation
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, ...)   auto MR_CONCAT( _prev_value_, __LINE__ ) = std::move( var ); ( var ) = ( __VA_ARGS__ ); MR_FINALLY { ( var ) = std::move( MR_CONCAT( _prev_value_, __LINE__ ) ); }
 change a variable's value until the current scope's end
 

Macro Definition Documentation

◆ MR_SCOPED_VALUE

#define MR_SCOPED_VALUE ( var,
... )   auto MR_CONCAT( _prev_value_, __LINE__ ) = std::move( var ); ( var ) = ( __VA_ARGS__ ); MR_FINALLY { ( var ) = std::move( MR_CONCAT( _prev_value_, __LINE__ ) ); }

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