This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
[handler.functions]
# 16 Library introduction [[library]](./#library)
## 16.4 Library-wide requirements [[requirements]](requirements#handler.functions)
### 16.4.5 Constraints on programs [[constraints]](constraints#handler.functions)
#### 16.4.5.7 Handler functions [handler.functions]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3415)
The C++ standard library provides a default version of the following handler
function ([[support]](support "17Language support library")):
- [(1.1)](#1.1)
terminate_handler
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3424)
A C++ program may install different handler functions during execution, by
supplying a pointer to a function defined in the program or the library
as an argument to (respectively):
- [(2.1)](#2.1)
set_new_handler
- [(2.2)](#2.2)
set_terminate
See also subclauses [[alloc.errors]](alloc.errors "17.6.4Storage allocation errors"), Storage allocation errors, and [[support.exception]](support.exception "17.9Exception handling"),
Exception handling[.](#2.sentence-1)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3435)
A C++ program can get a pointer to the current handler function by calling the following
functions:
- [(3.1)](#3.1)
get_new_handler
- [(3.2)](#3.2)
get_terminate
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3447)
Calling the set_* and get_* functions shall not incur a data race ([[intro.races]](intro.races "6.10.2.2Data races"))[.](#4.sentence-1)
A call to any of the set_* functions synchronizes with subsequent calls to the sameset_* function and to the corresponding get_* function[.](#4.sentence-2)