stlab 2.3.0
Modern, modular C++ algorithms, data structures, and concurrency primitives
Loading...
Searching...
No Matches
pre_exit.hpp
Go to the documentation of this file.
1/*
2 Copyright 2022 Adobe
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5*/
6/**************************************************************************************************/
7
8#ifndef STLAB_PRE_EXIT_HPP
9#define STLAB_PRE_EXIT_HPP
10
20
21/**************************************************************************************************/
22
23// The namespace for pre_exit cannot be changed without an ABI break. If making an ABI breaking
24// change in this file it needs to be done in a way supporting this version as well.
25
26namespace stlab {
27inline namespace v2 {
28
33
34/**************************************************************************************************/
35
37using pre_exit_handler = void (*)() noexcept;
38
41extern "C" void stlab_pre_exit();
45
49inline void pre_exit() { stlab_pre_exit(); }
50
54
55/**************************************************************************************************/
56
58
59} // namespace v2
60} // namespace stlab
61
62/**************************************************************************************************/
63
64#endif
65
66/**************************************************************************************************/
void(*)() noexcept pre_exit_handler
Function type invoked during pre_exit() (must not throw; noexcept with C++17 and later).
Definition pre_exit.hpp:37
void at_pre_exit(pre_exit_handler f)
Register a pre-exit handler. The pre-exit-handler may not throw. With C++17 or later it is required t...
Definition pre_exit.hpp:53
void stlab_pre_exit()
An extern "C" vector for pre-exit() to make it simpler to export the function from a shared library.
void stlab_at_pre_exit(pre_exit_handler f)
An extern "C" vector for at_pre-exit() to make it simpler to export the function from a shared librar...
void pre_exit()
Invoke all registered pre-exit handlers in the reverse order they are registered. It is safe to regis...
Definition pre_exit.hpp:49
Definition pre_exit.hpp:27
Definition reverse.hpp:28