13#ifndef RANGES_V3_UTILITY_SCOPE_EXIT_HPP
14#define RANGES_V3_UTILITY_SCOPE_EXIT_HPP
22#include <range/v3/detail/prologue.hpp>
26 template<
typename Fun>
30 using nothrow_move_t = std::is_nothrow_move_constructible<Fun>;
31 using nothrow_copy_t = std::is_nothrow_copy_constructible<Fun>;
34 bool dismissed_{
false};
36 using ref_t =
decltype(std::ref(std::declval<Fun const &>()));
49 scope_exit(Fun
const & fun, std::true_type) noexcept
53 scope_exit(Fun && fun, std::true_type) noexcept
54 : fun_(std::move(fun))
71 std::is_nothrow_move_constructible<Fun>::value)
72 :
scope_exit(std::move((that.dismiss(), that)).fun_)
81 void dismiss()
noexcept
87 template<
typename Fun,
typename ScopeExit = scope_exit<meta::_t<std::decay<Fun>>>>
88 ScopeExit make_scope_exit(Fun && fun)
noexcept(
89 noexcept(ScopeExit(ScopeExit((Fun &&) fun))))
91 return ScopeExit((Fun &&) fun);
95#include <range/v3/detail/epilogue.hpp>
Definition: scope_exit.hpp:28