xtd 0.2.0
Loading...
Searching...
No Matches
scope_exit.hpp
Go to the documentation of this file.
1
4#pragma once
5#include <utility>
6#define __XTD_CORE_INTERNAL__
8#undef __XTD_CORE_INTERNAL__
9
11namespace xtd {
65 struct scope_exit {};
66
68 template<class function_t>
69 auto operator +(scope_exit, function_t&& function) {
70 return __xtd_scope_exit_object__<function_t> {std::forward<function_t>(function)};
71 }
73}
74
128#define scope_exit_ [[maybe_unused]] auto __xtd_scope_id__(__xtd__scope_exit__, __LINE__) = xtd::scope_exit {} + [&]
Contains xtd_scope_cat and xtd_scope_id helpers.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Nowadays, every C++ developer is familiar with the Resource Acquisition Is Initialization (RAII) tech...
Definition scope_exit.hpp:65