2#ifndef TETL_SCOPE_SCOPE_GUARD_HPP
3#define TETL_SCOPE_SCOPE_GUARD_HPP
10template <
typename FuncT,
typename PolicyT>
14 explicit constexpr scope_guard(F&& f)
19 constexpr scope_guard(scope_guard&& rhs) noexcept
25 constexpr ~scope_guard()
32 constexpr auto release() noexcept ->
void { _policy.release(); }
34 scope_guard(scope_guard
const&) =
delete;
35 auto operator=(scope_guard
const&) -> scope_guard& =
delete;
36 auto operator=(scope_guard&&) -> scope_guard& =
delete;
43struct scope_exit_impl {
44 constexpr scope_exit_impl() =
default;
46 constexpr scope_exit_impl(scope_exit_impl&& rhs) noexcept
47 : should_execute{rhs.should_execute}
52 constexpr auto release() noexcept ->
void { should_execute =
false; }
54 explicit constexpr operator bool() const noexcept {
return should_execute; }
56 bool should_execute =
true;
constexpr auto move(InputIt first, InputIt last, OutputIt destination) -> OutputIt
Moves the elements in the range [first, last), to another range beginning at destination,...
Definition move.hpp:26
constexpr auto forward(remove_reference_t< T > ¶m) noexcept -> T &&
Forwards lvalues as either lvalues or as rvalues, depending on T. When t is a forwarding reference (a...
Definition forward.hpp:18