[res.on.functions]

# 16 Library introduction [[library]](./#library)

## 16.4 Library-wide requirements [[requirements]](requirements#res.on.functions)

### 16.4.5 Constraints on programs [[constraints]](constraints#res.on.functions)

#### 16.4.5.8 Other functions [res.on.functions]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3454)

In certain cases (replacement functions, handler functions, operations on types used to
instantiate standard library template components), the C++ standard library depends on
components supplied by a C++ program[.](#1.sentence-1)

If these components do not meet their requirements, this document places no requirements
on the implementation[.](#1.sentence-2)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3461)

In particular, the behavior is undefined in the following cases:

- [(2.1)](#2.1)

  For replacement functions ([[replacement.functions]](replacement.functions "16.4.5.6 Replacement functions")), if the installed replacement function does not
implement the semantics of the applicable*Required behavior*: paragraph[.](#2.1.sentence-1)

- [(2.2)](#2.2)

  For handler functions ([[new.handler]](new.handler "17.6.4.3 Type new_­handler"), [[terminate.handler]](terminate.handler "17.9.5.1 Type terminate_­handler")),
if the installed handler function does not implement the semantics of the applicable*Required behavior*: paragraph[.](#2.2.sentence-1)

- [(2.3)](#2.3)

  For types used as template arguments when instantiating a template component,
if the operations on the type do not implement the semantics of the applicableRequirements subclause ([[allocator.requirements]](allocator.requirements "16.4.4.6 Cpp17Allocator requirements"), [[container.requirements]](container.requirements "23.2 Requirements"), [[iterator.requirements]](iterator.requirements "24.3 Iterator requirements"), [[algorithms.requirements]](algorithms.requirements "26.2 Algorithms requirements"), [[numeric.requirements]](numeric.requirements "29.2 Numeric type requirements"))[.](#2.3.sentence-1)
  Operations on such types can report a failure by throwing an exception
unless otherwise specified[.](#2.3.sentence-2)

- [(2.4)](#2.4)

  If any replacement function or handler function or destructor operation exits via an exception,
unless specifically allowed
in the applicable*Required behavior*: paragraph[.](#2.4.sentence-1)

- [(2.5)](#2.5)

  If an incomplete type ([[basic.types.general]](basic.types.general#term.incomplete.type "6.9.1 General")) is used as a template
argument when instantiating a template component or evaluating a concept, unless specifically
allowed for that component[.](#2.5.sentence-1)
