From Jason Turner

[utility.undefined]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp680t27_t/{from.md → to.md} +35 -0
tmp/tmp680t27_t/{from.md → to.md} RENAMED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Undefined behavior <a id="utility.undefined">[[utility.undefined]]</a>
2
+
3
+ ``` cpp
4
+ [[noreturn]] void unreachable();
5
+ ```
6
+
7
+ *Preconditions:* `false` is `true`.
8
+
9
+ [*Note 1*: This precondition cannot be satisfied, thus the behavior of
10
+ calling `unreachable` is undefined. — *end note*]
11
+
12
+ [*Example 1*:
13
+
14
+ ``` cpp
15
+ int f(int x) {
16
+ switch (x) {
17
+ case 0:
18
+ case 1:
19
+ return x;
20
+ default:
21
+ std::unreachable();
22
+ }
23
+ }
24
+ int a = f(1); // OK, a has value 1
25
+ int b = f(3); // undefined behavior
26
+ ```
27
+
28
+ — *end example*]
29
+
30
+ ``` cpp
31
+ void observable_checkpoint() noexcept;
32
+ ```
33
+
34
+ *Effects:* Establishes an observable checkpoint [[intro.abstract]].
35
+