Files
cppdraft_translate/cppdraft/utility/undefined.md
2025-10-25 03:02:53 +03:00

1.2 KiB

[utility.undefined]

22 General utilities library [utilities]

22.2 Utility components [utility]

22.2.9 Undefined behavior [utility.undefined]

🔗

[[noreturn]] void unreachable();

1

#

Preconditions: false is true.

[Note 1:

This precondition cannot be satisfied, thus the behavior of calling unreachable is undefined.

— end note]

2

#

[Example 1: int f(int x) {switch (x) {case 0:case 1:return x; default: std::unreachable(); }}int a = f(1); // OK, a has value 1int b = f(3); // undefined behavior — end example]

🔗

void observable_checkpoint() noexcept;

3

#

Effects: Establishes an observable checkpoint ([intro.abstract]).