From Jason Turner

[structure.specifications]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpw63oblzq/{from.md → to.md} +48 -17
tmp/tmpw63oblzq/{from.md → to.md} RENAMED
@@ -25,54 +25,85 @@ appropriate):[^5]
25
  overload resolution [[over.match]]. \[*Note 1*: Failure to meet such a
26
  condition results in the function’s silent
27
  non-viability. — *end note*] \[*Example 1*: An implementation can
28
  express such a condition via a *constraint-expression*
29
  [[temp.constr.decl]]. — *end example*]
 
30
  - *Mandates:* the conditions that, if not met, render the program
31
  ill-formed. \[*Example 2*: An implementation can express such a
32
  condition via the *constant-expression* in a
33
  *static_assert-declaration* [[dcl.pre]]. If the diagnostic is to be
34
  emitted only after the function has been selected by overload
35
  resolution, an implementation can express such a condition via a
36
  *constraint-expression* [[temp.constr.decl]] and also define the
37
  function as deleted. — *end example*]
38
- - *Preconditions:* the conditions that the function assumes to hold
39
- whenever it is called; violation of any preconditions results in
40
- undefined behavior.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  - *Effects:* the actions performed by the function.
 
42
  - *Synchronization:* the synchronization operations
43
  [[intro.multithread]] applicable to the function.
 
44
  - *Ensures:* the conditions (sometimes termed observable results)
45
- established by the function.
 
 
 
46
  - *Result:* for a *typename-specifier*, a description of the named type;
47
- for an *expression*, a description of the type of the expression; the
48
- expression is an lvalue if the type is an lvalue reference type, an
49
- xvalue if the type is an rvalue reference type, and a prvalue
50
- otherwise.
 
51
  - *Returns:* a description of the value(s) returned by the function.
 
52
  - *Throws:* any exceptions thrown by the function, and the conditions
53
  that would cause the exception.
 
54
  - *Complexity:* the time and/or space complexity of the function.
 
55
  - *Remarks:* additional semantic constraints on the function.
 
56
  - *Error conditions:* the error conditions for error codes reported by
57
  the function.
58
 
59
  Whenever the *Effects* element specifies that the semantics of some
60
  function `F` are *Equivalent to* some code sequence, then the various
61
  elements are interpreted as follows. If `F`’s semantics specifies any
62
  *Constraints* or *Mandates* elements, then those requirements are
63
  logically imposed prior to the *equivalent-to* semantics. Next, the
64
  semantics of the code sequence are determined by the *Constraints*,
65
- *Mandates*, *Preconditions*, *Effects*, *Synchronization*,
66
- *Postconditions*, *Returns*, *Throws*, *Complexity*, *Remarks*, and
67
- *Error conditions* specified for the function invocations contained in
68
- the code sequence. The value returned from `F` is specified by `F`’s
69
- *Returns* element, or if `F` has no *Returns* element, a non-`void`
70
- return from `F` is specified by the `return` statements [[stmt.return]]
71
- in the code sequence. If `F`’s semantics contains a *Throws*,
72
- *Postconditions*, or *Complexity* element, then that supersedes any
73
- occurrences of that element in the code sequence.
 
74
 
75
  For non-reserved replacement and handler functions, [[support]]
76
  specifies two behaviors for the functions in question: their required
77
  and default behavior. The *default behavior* describes a function
78
  definition provided by the implementation. The *required behavior*
 
25
  overload resolution [[over.match]]. \[*Note 1*: Failure to meet such a
26
  condition results in the function’s silent
27
  non-viability. — *end note*] \[*Example 1*: An implementation can
28
  express such a condition via a *constraint-expression*
29
  [[temp.constr.decl]]. — *end example*]
30
+
31
  - *Mandates:* the conditions that, if not met, render the program
32
  ill-formed. \[*Example 2*: An implementation can express such a
33
  condition via the *constant-expression* in a
34
  *static_assert-declaration* [[dcl.pre]]. If the diagnostic is to be
35
  emitted only after the function has been selected by overload
36
  resolution, an implementation can express such a condition via a
37
  *constraint-expression* [[temp.constr.decl]] and also define the
38
  function as deleted. — *end example*]
39
+
40
+ - the conditions that are required for a call to the function to be a
41
+ constant subexpression [[defns.const.subexpr]].
42
+
43
+ - *Preconditions:* conditions that the function assumes to hold whenever
44
+ it is called; violation of any preconditions results in undefined
45
+ behavior. \[*Example 3*: An implementation can express some such
46
+ conditions via the use of a contract assertion, such as a precondition
47
+ assertion [[dcl.contract.func]]. — *end example*]
48
+
49
+ - conditions that the function assumes to hold whenever it is called.
50
+ - When invoking the function in a hardened implementation, prior to
51
+ any other observable side effects of the function, one or more
52
+ contract assertions whose predicates are as described in the
53
+ hardened precondition are evaluated with a checking semantic
54
+ [[basic.contract.eval]]. If any of these assertions is evaluated
55
+ with a non-terminating semantic and the contract-violation handler
56
+ returns, the program has undefined behavior.
57
+ - When invoking the function in a non-hardened implementation, if any
58
+ hardened precondition is violated, the program has undefined
59
+ behavior.
60
+
61
  - *Effects:* the actions performed by the function.
62
+
63
  - *Synchronization:* the synchronization operations
64
  [[intro.multithread]] applicable to the function.
65
+
66
  - *Ensures:* the conditions (sometimes termed observable results)
67
+ established by the function. \[*Example 4*: An implementation can
68
+ express some such conditions via the use of a contract assertion, such
69
+ as a postcondition assertion [[dcl.contract.func]]. — *end example*]
70
+
71
  - *Result:* for a *typename-specifier*, a description of the named type;
72
+ for an *expression*, a description of the type and value category of
73
+ the expression; the expression is an lvalue if the type is an lvalue
74
+ reference type, an xvalue if the type is an rvalue reference type, and
75
+ a prvalue otherwise.
76
+
77
  - *Returns:* a description of the value(s) returned by the function.
78
+
79
  - *Throws:* any exceptions thrown by the function, and the conditions
80
  that would cause the exception.
81
+
82
  - *Complexity:* the time and/or space complexity of the function.
83
+
84
  - *Remarks:* additional semantic constraints on the function.
85
+
86
  - *Error conditions:* the error conditions for error codes reported by
87
  the function.
88
 
89
  Whenever the *Effects* element specifies that the semantics of some
90
  function `F` are *Equivalent to* some code sequence, then the various
91
  elements are interpreted as follows. If `F`’s semantics specifies any
92
  *Constraints* or *Mandates* elements, then those requirements are
93
  logically imposed prior to the *equivalent-to* semantics. Next, the
94
  semantics of the code sequence are determined by the *Constraints*,
95
+ *Mandates*, *Constant When*, *Preconditions*, *Hardened preconditions*,
96
+ *Effects*, *Synchronization*, *Postconditions*, *Returns*, *Throws*,
97
+ *Complexity*, *Remarks*, and *Error conditions* specified for the
98
+ function invocations contained in the code sequence. The value returned
99
+ from `F` is specified by `F`’s *Returns* element, or if `F` has no
100
+ *Returns* element, a non-`void` return from `F` is specified by the
101
+ `return` statements [[stmt.return]] in the code sequence. If `F`’s
102
+ semantics contains a *Throws*, *Postconditions*, or *Complexity*
103
+ element, then that supersedes any occurrences of that element in the
104
+ code sequence.
105
 
106
  For non-reserved replacement and handler functions, [[support]]
107
  specifies two behaviors for the functions in question: their required
108
  and default behavior. The *default behavior* describes a function
109
  definition provided by the implementation. The *required behavior*