26#ifndef GUL17_FINALIZER_H_
27#define GUL17_FINALIZER_H_
127 : action_(std::move(
f))
131 : action_{ std::move(
other.action_) }
132 , invoke_{
other.invoke_ }
135 other.invoke_ =
false;
139 if (
this != &
other) {
140 this->action_ = std::move(
other.action_);
141 this->invoke_ = std::move(
other.invoke_);
143 other.invoke_ =
false;
FinalAction allows us to execute something if the FinalAction object leaves the scope.
Definition finalizer.h:109
FinalAction(FinalAction &&other) noexcept
Move constructor.
Definition finalizer.h:130
FinalAction(F f) noexcept
Creates a new FinalAction object.
Definition finalizer.h:126
FinalAction()=delete
FinalAction is not is_default_constructible.
FinalAction(const FinalAction &)=delete
FinalAction is not copyable.
FinalAction & operator=(const FinalAction &)=delete
FinalAction is not copyable.
FinalAction & operator=(FinalAction &&other) noexcept
Move assignment operator.
Definition finalizer.h:138
~FinalAction() noexcept
Destructor Calls action except when in move contexts.
Definition finalizer.h:154
auto constexpr bit_set(unsigned bit) noexcept -> ReturnT
Set a bit in an integral type.
Definition bit_manip.h:124
Definition of macros used internally by GUL.
Namespace gul17 contains all functions and classes of the General Utility Library.
Definition doxygen.h:29