Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Test helper to perform temporary manipulations within a test scope.
Such safe manipulations can be achieved by tying the clean-up to the destructor of a token object in local scope. In the simple form, a reference to the original and the original value are captured; alternatively, both manipulation and clean-up can be given as Lambdas.
Definition in file transiently.hpp.
#include "lib/nocopy.hpp"
#include "lib/meta/function.hpp"
#include "lib/ppmpl.h"
#include <utility>
Classes | |
class | Transiently< TAR > |
Token to capture a value and restore original when leaving scope. More... | |
class | Transiently< void(void)> |
Variation where manipulation is done by λ More... | |
Macros | |
#define | TRANSIENTLY(_OO_) lib::test::Transiently PPMPL_CAT(transientlyManipulated_,__LINE__)(_OO_); PPMPL_CAT(transientlyManipulated_,__LINE__) |
Macro to simplify capturing assignments. More... | |
Functions | |
template<typename FUN , typename = lib::meta::enable_if<lib::meta::has_Sig<FUN, void(void)>>> | |
Transiently (FUN &&) -> Transiently< void(void)> | |
deduction guide: use λ for manipulation and clean-up More... | |
Namespaces | |
lib | |
Implementation namespace for support and library code. | |
#define TRANSIENTLY | ( | _OO_ | ) | lib::test::Transiently PPMPL_CAT(transientlyManipulated_,__LINE__)(_OO_); PPMPL_CAT(transientlyManipulated_,__LINE__) |
Macro to simplify capturing assignments.
TRANSIENTLY(blah) = moo;
Definition at line 121 of file transiently.hpp.
Referenced by TestHelper_test::checkLocalManipulation(), SchedulerStress_test::investigateWorkProcessing(), BreakingPoint< CONF >::perform(), and ParameterRange< CONF >::perform().
lib::test::Transiently | ( | FUN && | ) | -> Transiently< void(void)> |
deduction guide: use λ for manipulation and clean-up