scoped: declare copy and move constructors

they aren't defined currently because we haven't needed them. this is
just to avoid accidents where the defaults will prove problematic.
This commit is contained in:
Danny Robson 2018-06-18 13:50:16 +10:00
parent 3722c8aaa3
commit db90a4db53

View File

@ -87,9 +87,8 @@ namespace util::scoped {
m_args (std::forward<Args> (_args)...) m_args (std::forward<Args> (_args)...)
{ ; } { ; }
function (function&&);
void disable (void) { m_enabled = false; } function (const function&);
~function () ~function ()
{ {
@ -97,6 +96,8 @@ namespace util::scoped {
std::apply (std::move (m_function), std::move (m_args)); std::apply (std::move (m_function), std::move (m_args));
} }
void disable (void) { m_enabled = false; }
private: private:
bool m_enabled = true; bool m_enabled = true;
FuncT m_function; FuncT m_function;