6#if !defined(__XTD_CORE_INTERNAL__)
7#error "Do not include this file: Internal use only"
14#define __xtd_scope_cat__(name, line) name##line
15#define __xtd_scope_id__(name, line) __xtd_scope_cat__(name, line)
17template<
class function_t>
18struct __xtd_scope_exit_object__ {
19 __xtd_scope_exit_object__(function_t&& f) :
function(std::forward<function_t>(
f)) {}
20 ~__xtd_scope_exit_object__() {
function(); }
24template<
typename function_t>
25struct __xtd_scope_fail_object__ {
26 __xtd_scope_fail_object__(function_t&& f) :
function(std::forward<function_t>(
f)) {}
27 ~__xtd_scope_fail_object__() noexcept {
if (std::uncaught_exceptions() > exceptions_on_enter)
function();}
28 int exceptions_on_enter = std::uncaught_exceptions();
32template<
typename function_t>
33struct __xtd_scope_success_object__ {
34 __xtd_scope_success_object__(function_t&& f) :
function(std::forward<function_t>(
f)) {}
35 ~__xtd_scope_success_object__() noexcept {
if (std::uncaught_exceptions() == exceptions_on_enter)
function();}
36 int exceptions_on_enter = std::uncaught_exceptions();
@ f
The F key.
Definition console_key.hpp:98