From Jason Turner

[expr.await]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpjuug_c2q/{from.md → to.md} +12 -8
tmp/tmpjuug_c2q/{from.md → to.md} RENAMED
@@ -1,27 +1,31 @@
1
  #### Await <a id="expr.await">[[expr.await]]</a>
2
 
3
  The `co_await` expression is used to suspend evaluation of a coroutine
4
  [[dcl.fct.def.coroutine]] while awaiting completion of the computation
5
- represented by the operand expression.
 
6
 
7
  ``` bnf
8
  await-expression:
9
- 'co_await' cast-expression
10
  ```
11
 
12
- An *await-expression* shall appear only in a potentially-evaluated
13
- expression within the *compound-statement* of a *function-body* outside
14
- of a *handler* [[except.pre]]. In a *declaration-statement* or in the
 
15
  *simple-declaration* (if any) of an *init-statement*, an
16
  *await-expression* shall appear only in an *initializer* of that
17
  *declaration-statement* or *simple-declaration*. An *await-expression*
18
  shall not appear in a default argument [[dcl.fct.default]]. An
19
  *await-expression* shall not appear in the initializer of a block
20
- variable with static or thread storage duration. A context within a
21
- function where an *await-expression* can appear is called a *suspension
22
- context* of the function.
 
 
23
 
24
  Evaluation of an *await-expression* involves the following auxiliary
25
  types, expressions, and objects:
26
 
27
  - *p* is an lvalue naming the promise object [[dcl.fct.def.coroutine]]
 
1
  #### Await <a id="expr.await">[[expr.await]]</a>
2
 
3
  The `co_await` expression is used to suspend evaluation of a coroutine
4
  [[dcl.fct.def.coroutine]] while awaiting completion of the computation
5
+ represented by the operand expression. Suspending the evaluation of a
6
+ coroutine transfers control to its caller or resumer.
7
 
8
  ``` bnf
9
  await-expression:
10
+ co_await cast-expression
11
  ```
12
 
13
+ An *await-expression* shall appear only as a potentially-evaluated
14
+ expression within the *compound-statement* of a *function-body* or
15
+ *lambda-expression*, in either case outside of a *handler*
16
+ [[except.pre]]. In a *declaration-statement* or in the
17
  *simple-declaration* (if any) of an *init-statement*, an
18
  *await-expression* shall appear only in an *initializer* of that
19
  *declaration-statement* or *simple-declaration*. An *await-expression*
20
  shall not appear in a default argument [[dcl.fct.default]]. An
21
  *await-expression* shall not appear in the initializer of a block
22
+ variable with static or thread storage duration. An *await-expression*
23
+ shall not be a potentially-evaluated subexpression of the predicate of a
24
+ contract assertion [[basic.contract]]. A context within a function where
25
+ an *await-expression* can appear is called a *suspension context* of the
26
+ function.
27
 
28
  Evaluation of an *await-expression* involves the following auxiliary
29
  types, expressions, and objects:
30
 
31
  - *p* is an lvalue naming the promise object [[dcl.fct.def.coroutine]]