scoped: rename disabling methods for consistency
This commit is contained in:
parent
25d98931b8
commit
4e7e2c812d
@ -108,7 +108,7 @@ circular<ValueT>::circular (size_t bytes)
|
|||||||
posix::error::throw_code ();
|
posix::error::throw_code ();
|
||||||
|
|
||||||
// all went well, disarm the failsafe
|
// all went well, disarm the failsafe
|
||||||
unmapper.disable ();
|
unmapper.release ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace cruft::scoped {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Disable restoration of the value.
|
/// Disable restoration of the value.
|
||||||
void reset (void) { m_restore = false; }
|
void release (void) { m_restore = false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_restore = true;
|
bool m_restore = true;
|
||||||
@ -91,7 +91,7 @@ namespace cruft::scoped {
|
|||||||
std::apply (m_function, m_args);
|
std::apply (m_function, m_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
void disable (void) { m_enabled = false; }
|
void release (void) { m_enabled = false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_enabled = true;
|
bool m_enabled = true;
|
||||||
|
@ -19,7 +19,7 @@ void test_restore (cruft::TAP::logger &tap)
|
|||||||
{
|
{
|
||||||
cruft::scoped::restore raii (value);
|
cruft::scoped::restore raii (value);
|
||||||
value = 7;
|
value = 7;
|
||||||
raii.reset ();
|
raii.release ();
|
||||||
}
|
}
|
||||||
|
|
||||||
tap.expect_eq (value, 7, "restorer reset doesn't modify value at destruction");
|
tap.expect_eq (value, 7, "restorer reset doesn't modify value at destruction");
|
||||||
|
Loading…
Reference in New Issue
Block a user