tmp/tmppymb_uva/{from.md → to.md}
RENAMED
|
@@ -1,48 +1,51 @@
|
|
| 1 |
#### Type-dependent expressions <a id="temp.dep.expr">[[temp.dep.expr]]</a>
|
| 2 |
|
| 3 |
Except as described below, an expression is type-dependent if any
|
| 4 |
subexpression is type-dependent.
|
| 5 |
|
| 6 |
-
`this`
|
| 7 |
-
|
| 8 |
-
is type-dependent if the class type of the enclosing member function is
|
| 9 |
dependent [[temp.dep.type]].
|
| 10 |
|
| 11 |
-
An *id-expression* is type-dependent if it is
|
| 12 |
-
|
| 13 |
|
| 14 |
-
-
|
| 15 |
-
|
| 16 |
-
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
-
|
| 20 |
-
|
| 21 |
-
the initializer is type-dependent,
|
| 22 |
-
- an *identifier* associated by name lookup with one or more
|
| 23 |
-
declarations of member functions of the current instantiation declared
|
| 24 |
-
with a return type that contains a placeholder type,
|
| 25 |
-
- an *identifier* associated by name lookup with a structured binding
|
| 26 |
-
declaration [[dcl.struct.bind]] whose *brace-or-equal-initializer* is
|
| 27 |
type-dependent,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
- the *identifier* `__func__` [[dcl.fct.def.general]], where any
|
| 29 |
enclosing function is a template, a member of a class template, or a
|
| 30 |
generic lambda,
|
| 31 |
-
- a *template-id* that is dependent,
|
| 32 |
- a *conversion-function-id* that specifies a dependent type, or
|
| 33 |
-
-
|
| 34 |
-
an unknown specialization;
|
| 35 |
|
| 36 |
or if it names a dependent member of the current instantiation that is a
|
| 37 |
static data member of type “array of unknown bound of `T`” for some `T`
|
| 38 |
[[temp.static]]. Expressions of the following forms are type-dependent
|
| 39 |
-
only if the type specified by the *type-id*, *simple-type-specifier*
|
| 40 |
-
*new-type-id* is dependent, even if any
|
|
|
|
| 41 |
|
| 42 |
``` bnf
|
| 43 |
simple-type-specifier '(' expression-listₒₚₜ ')'
|
|
|
|
|
|
|
|
|
|
| 44 |
'::'ₒₚₜ new new-placementₒₚₜ new-type-id new-initializerₒₚₜ
|
| 45 |
'::'ₒₚₜ new new-placementₒₚₜ '(' type-id ')' new-initializerₒₚₜ
|
| 46 |
dynamic_cast '<' type-id '>' '(' expression ')'
|
| 47 |
static_cast '<' type-id '>' '(' expression ')'
|
| 48 |
const_cast '<' type-id '>' '(' expression ')'
|
|
@@ -69,21 +72,19 @@ noexcept '(' expression ')'
|
|
| 69 |
|
| 70 |
[*Note 1*: For the standard library macro `offsetof`, see
|
| 71 |
[[support.types]]. — *end note*]
|
| 72 |
|
| 73 |
A class member access expression [[expr.ref]] is type-dependent if the
|
|
|
|
| 74 |
expression refers to a member of the current instantiation and the type
|
| 75 |
-
of the referenced member is dependent
|
| 76 |
-
expression refers to a member of an unknown specialization.
|
| 77 |
|
| 78 |
[*Note 2*: In an expression of the form `x.y` or `xp->y` the type of
|
| 79 |
the expression is usually the type of the member `y` of the class of `x`
|
| 80 |
(or the class pointed to by `xp`). However, if `x` or `xp` refers to a
|
| 81 |
dependent type that is not the current instantiation, the type of `y` is
|
| 82 |
-
always dependent.
|
| 83 |
-
refers to the current instantiation, the type of `y` is the type of the
|
| 84 |
-
class member access expression. — *end note*]
|
| 85 |
|
| 86 |
A *braced-init-list* is type-dependent if any element is type-dependent
|
| 87 |
or is a pack expansion.
|
| 88 |
|
| 89 |
A *fold-expression* is type-dependent.
|
|
|
|
| 1 |
#### Type-dependent expressions <a id="temp.dep.expr">[[temp.dep.expr]]</a>
|
| 2 |
|
| 3 |
Except as described below, an expression is type-dependent if any
|
| 4 |
subexpression is type-dependent.
|
| 5 |
|
| 6 |
+
`this` is type-dependent if the current class [[expr.prim.this]] is
|
|
|
|
|
|
|
| 7 |
dependent [[temp.dep.type]].
|
| 8 |
|
| 9 |
+
An *id-expression* is type-dependent if it is a *template-id* that is
|
| 10 |
+
not a concept-id and is dependent; or if its terminal name is
|
| 11 |
|
| 12 |
+
- associated by name lookup with one or more declarations declared with
|
| 13 |
+
a dependent type,
|
| 14 |
+
- associated by name lookup with a non-type *template-parameter*
|
| 15 |
+
declared with a type that contains a placeholder type
|
| 16 |
+
[[dcl.spec.auto]],
|
| 17 |
+
- associated by name lookup with a variable declared with a type that
|
| 18 |
+
contains a placeholder type [[dcl.spec.auto]] where the initializer is
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
type-dependent,
|
| 20 |
+
- associated by name lookup with one or more declarations of member
|
| 21 |
+
functions of a class that is the current instantiation declared with a
|
| 22 |
+
return type that contains a placeholder type,
|
| 23 |
+
- associated by name lookup with a structured binding declaration
|
| 24 |
+
[[dcl.struct.bind]] whose *brace-or-equal-initializer* is
|
| 25 |
+
type-dependent,
|
| 26 |
+
- associated by name lookup with an entity captured by copy
|
| 27 |
+
[[expr.prim.lambda.capture]] in a *lambda-expression* that has an
|
| 28 |
+
explicit object parameter whose type is dependent [[dcl.fct]],
|
| 29 |
- the *identifier* `__func__` [[dcl.fct.def.general]], where any
|
| 30 |
enclosing function is a template, a member of a class template, or a
|
| 31 |
generic lambda,
|
|
|
|
| 32 |
- a *conversion-function-id* that specifies a dependent type, or
|
| 33 |
+
- dependent
|
|
|
|
| 34 |
|
| 35 |
or if it names a dependent member of the current instantiation that is a
|
| 36 |
static data member of type “array of unknown bound of `T`” for some `T`
|
| 37 |
[[temp.static]]. Expressions of the following forms are type-dependent
|
| 38 |
+
only if the type specified by the *type-id*, *simple-type-specifier*,
|
| 39 |
+
*typename-specifier*, or *new-type-id* is dependent, even if any
|
| 40 |
+
subexpression is type-dependent:
|
| 41 |
|
| 42 |
``` bnf
|
| 43 |
simple-type-specifier '(' expression-listₒₚₜ ')'
|
| 44 |
+
simple-type-specifier braced-init-list
|
| 45 |
+
typename-specifier '(' expression-listₒₚₜ ')'
|
| 46 |
+
typename-specifier braced-init-list
|
| 47 |
'::'ₒₚₜ new new-placementₒₚₜ new-type-id new-initializerₒₚₜ
|
| 48 |
'::'ₒₚₜ new new-placementₒₚₜ '(' type-id ')' new-initializerₒₚₜ
|
| 49 |
dynamic_cast '<' type-id '>' '(' expression ')'
|
| 50 |
static_cast '<' type-id '>' '(' expression ')'
|
| 51 |
const_cast '<' type-id '>' '(' expression ')'
|
|
|
|
| 72 |
|
| 73 |
[*Note 1*: For the standard library macro `offsetof`, see
|
| 74 |
[[support.types]]. — *end note*]
|
| 75 |
|
| 76 |
A class member access expression [[expr.ref]] is type-dependent if the
|
| 77 |
+
terminal name of its *id-expression*, if any, is dependent or the
|
| 78 |
expression refers to a member of the current instantiation and the type
|
| 79 |
+
of the referenced member is dependent.
|
|
|
|
| 80 |
|
| 81 |
[*Note 2*: In an expression of the form `x.y` or `xp->y` the type of
|
| 82 |
the expression is usually the type of the member `y` of the class of `x`
|
| 83 |
(or the class pointed to by `xp`). However, if `x` or `xp` refers to a
|
| 84 |
dependent type that is not the current instantiation, the type of `y` is
|
| 85 |
+
always dependent. — *end note*]
|
|
|
|
|
|
|
| 86 |
|
| 87 |
A *braced-init-list* is type-dependent if any element is type-dependent
|
| 88 |
or is a pack expansion.
|
| 89 |
|
| 90 |
A *fold-expression* is type-dependent.
|