27 #ifndef LIB_TEST_TRANSIENTLY_H 28 #define LIB_TEST_TRANSIENTLY_H 44 template<
typename TAR>
53 : originalVal_{target}
54 , manipulated_{target}
59 manipulated_ = std::move (originalVal_);
66 manipulated_ = std::forward<X> (x);
76 using Manipulator = std::function<void(void)>;
83 : doIt_{std::move (manipulation)}
89 CHECK (undoIt_,
"REJECT Manipulation -- " 90 "Failed to provide a way " 91 "to undo the manipulation.");
96 cleanUp (Manipulator cleanUp)
98 undoIt_ = std::move (cleanUp);
107 template<
typename FUN,
typename=lib::meta::enable_if<lib::meta::has_Sig<FUN,
void(
void)>>>
121 #define TRANSIENTLY(_OO_) \ 122 lib::test::Transiently PPMPL_CAT(transientlyManipulated_,__LINE__)(_OO_); PPMPL_CAT(transientlyManipulated_,__LINE__)
Any copy and copy construction prohibited.
Implementation namespace for support and library code.
Variation where manipulation is done by λ
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Metaprogramming tools for transforming functor types.
Preprocessor metaprogramming library.
Token to capture a value and restore original when leaving scope.