From Jason Turner

[support.contract.violation]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpn3ryed9j/{from.md → to.md} +77 -0
tmp/tmpn3ryed9j/{from.md → to.md} RENAMED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Class `contract_violation` <a id="support.contract.violation">[[support.contract.violation]]</a>
2
+
3
+ The class `contract_violation` defines the type of objects used to
4
+ represent a contract violation that has been detected during the
5
+ evaluation of a contract assertion with a particular evaluation semantic
6
+ [[basic.contract.eval]]. Objects of this type can be created only by the
7
+ implementation. It is *implementation-defined* whether the destructor is
8
+ virtual.
9
+
10
+ ``` cpp
11
+ const char* comment() const noexcept;
12
+ ```
13
+
14
+ *Returns:* An *implementation-defined* NTMBS in the ordinary literal
15
+ encoding [[lex.charset]].
16
+
17
+ *Recommended practice:* The string returned should contain a textual
18
+ representation of the predicate of the violated contract assertion or an
19
+ empty string if storing a textual representation is undesired.
20
+
21
+ [*Note 1*: The string can represent a truncated, reformatted, or
22
+ summarized rendering of the predicate, before or after
23
+ preprocessing. — *end note*]
24
+
25
+ ``` cpp
26
+ contracts::detection_mode detection_mode() const noexcept;
27
+ ```
28
+
29
+ *Returns:* The enumerator value corresponding to the manner in which the
30
+ contract violation was identified.
31
+
32
+ ``` cpp
33
+ exception_ptr evaluation_exception() const noexcept;
34
+ ```
35
+
36
+ *Returns:* If the contract violation occurred because the evaluation of
37
+ the predicate exited via an exception, an `exception_ptr` object that
38
+ refers to that exception or a copy of that exception; otherwise, a null
39
+ `exception_ptr` object.
40
+
41
+ ``` cpp
42
+ bool is_terminating() const noexcept;
43
+ ```
44
+
45
+ *Returns:* `true` if the evaluation semantic is a terminating
46
+ semantic [[basic.contract.eval]]; otherwise, `false`.
47
+
48
+ ``` cpp
49
+ assertion_kind kind() const noexcept;
50
+ ```
51
+
52
+ *Returns:* The enumerator value corresponding to the syntactic form of
53
+ the violated contract assertion.
54
+
55
+ ``` cpp
56
+ source_location location() const noexcept;
57
+ ```
58
+
59
+ *Returns:* A `source_location` object with *implementation-defined*
60
+ value.
61
+
62
+ *Recommended practice:* The value returned should be a default
63
+ constructed `source_location` object or a value identifying the violated
64
+ contract assertion:
65
+
66
+ - When possible, if the violated contract assertion was a precondition,
67
+ the source location of the function invocation should be returned.
68
+ - Otherwise, the source location of the contract assertion should be
69
+ returned.
70
+
71
+ ``` cpp
72
+ evaluation_semantic semantic() const noexcept;
73
+ ```
74
+
75
+ *Returns:* The enumerator value corresponding to the evaluation semantic
76
+ with which the violated contract assertion was evaluated.
77
+