23 #ifndef GUL14_FINALIZER_H_
24 #define GUL14_FINALIZER_H_
26 #include <type_traits>
104 template <
typename F>
124 : action_(std::move(f))
128 : action_{ std::move(other.action_) }
129 , invoke_{ other.invoke_ }
132 other.invoke_ =
false;
136 if (
this != &other) {
137 this->action_ = std::move(other.action_);
138 this->invoke_ = std::move(other.invoke_);
140 other.invoke_ =
false;
168 template <
typename F>
FinalAction allows us to execute something if the FinalAction object leaves the scope.
Definition: finalizer.h:106
FinalAction & operator=(const FinalAction &)=delete
FinalAction is not copyable.
FinalAction & operator=(FinalAction &&other) noexcept
Move assignment operator.
Definition: finalizer.h:135
~FinalAction() noexcept
Destructor Calls action except when in move contexts.
Definition: finalizer.h:151
FinalAction(const FinalAction &)=delete
FinalAction is not copyable.
FinalAction(FinalAction &&other) noexcept
Move constructor.
Definition: finalizer.h:127
FinalAction()=delete
FinalAction is not is_default_constructible.
FinalAction(F f) noexcept
Creates a new FinalAction object.
Definition: finalizer.h:123
Definition of macros used internally by GUL.
Namespace gul14 contains all functions and classes of the General Utility Library.
Definition: doxygen.h:26