![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
Test helper to perform temporary manipulations within a test scope. More...
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>Namespaces | |
| namespace | lib |
| Implementation namespace for support and library code. | |
| namespace | lib::test |
| Unit tests for the Lumiera support library. | |
Macros | |
| #define | TRANSIENTLY(_OO_) lib::test::Transiently PPMPL_CAT(transientlyManipulated_,__LINE__)(_OO_); PPMPL_CAT(transientlyManipulated_,__LINE__) |
| Macro to simplify capturing assignments. | |
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... | |
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 | |
| #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.