23 #ifndef GUL14_FINALIZER_H_
24 #define GUL14_FINALIZER_H_
26 #include <type_traits>
117 : action_(std::move(f))
121 : action_{ std::move(other.action_) }
122 , invoke_{ other.invoke_ }
125 other.invoke_ =
false;
129 if (
this != &other) {
130 this->action_ = std::move(other.action_);
131 this->invoke_ = std::move(other.invoke_);
133 other.invoke_ =
false;
161 template <
typename F>
FinalAction allows us to execute something if the FinalAction object leaves the scope.
Definition: finalizer.h:99
FinalAction & operator=(const FinalAction &)=delete
FinalAction is not copyable.
FinalAction & operator=(FinalAction &&other) noexcept
Move assignment operator.
Definition: finalizer.h:128
~FinalAction() noexcept
Destructor Calls action except when in move contexts.
Definition: finalizer.h:144
FinalAction(const FinalAction &)=delete
FinalAction is not copyable.
FinalAction(FinalAction &&other) noexcept
Move constructor.
Definition: finalizer.h:120
FinalAction()=delete
FinalAction is not is_default_constructible.
FinalAction(F f) noexcept
Creates a new FinalAction object.
Definition: finalizer.h:116
Definition of macros used internally by GUL.
Namespace gul14 contains all functions and classes of the General Utility Library.
Definition: doxygen.h:26