tmp/tmpuy_iie2c/{from.md → to.md}
RENAMED
|
@@ -1,21 +1,21 @@
|
|
| 1 |
### Relationships between types <a id="meta.rel">[[meta.rel]]</a>
|
| 2 |
|
| 3 |
This subclause contains templates that may be used to query
|
| 4 |
relationships between types at compile time.
|
| 5 |
|
| 6 |
-
Each of these templates shall be a
|
| 7 |
with a base characteristic of `true_type` if the corresponding condition
|
| 8 |
is true, otherwise `false_type`.
|
| 9 |
|
| 10 |
[*Note 1*: Base classes that are private, protected, or ambiguous are,
|
| 11 |
nonetheless, base classes. — *end note*]
|
| 12 |
|
| 13 |
For the purpose of defining the templates in this subclause, a function
|
| 14 |
call expression `declval<T>()` for any type `T` is considered to be a
|
| 15 |
trivial ([[basic.types]], [[special]]) function call that is not an
|
| 16 |
-
odr-use
|
| 17 |
corresponding definition notwithstanding the restrictions of
|
| 18 |
[[declval]].
|
| 19 |
|
| 20 |
[*Example 1*:
|
| 21 |
|
|
@@ -46,17 +46,17 @@ implicit conversions to the return type of the function:
|
|
| 46 |
To test() {
|
| 47 |
return declval<From>();
|
| 48 |
}
|
| 49 |
```
|
| 50 |
|
| 51 |
-
[*Note 2*: This requirement gives well
|
| 52 |
types, void types, array types, and function types. — *end note*]
|
| 53 |
|
| 54 |
Access checking is performed in a context unrelated to `To` and `From`.
|
| 55 |
Only the validity of the immediate context of the *expression* of the
|
| 56 |
-
`return` statement (including initialization of the
|
| 57 |
-
reference) is considered.
|
| 58 |
|
| 59 |
[*Note 3*: The initialization can result in side effects such as the
|
| 60 |
instantiation of class template specializations and function template
|
| 61 |
specializations, the generation of implicitly-defined functions, and so
|
| 62 |
on. Such side effects are not in the “immediate context” and can result
|
|
|
|
| 1 |
### Relationships between types <a id="meta.rel">[[meta.rel]]</a>
|
| 2 |
|
| 3 |
This subclause contains templates that may be used to query
|
| 4 |
relationships between types at compile time.
|
| 5 |
|
| 6 |
+
Each of these templates shall be a *Cpp17BinaryTypeTrait* [[meta.rqmts]]
|
| 7 |
with a base characteristic of `true_type` if the corresponding condition
|
| 8 |
is true, otherwise `false_type`.
|
| 9 |
|
| 10 |
[*Note 1*: Base classes that are private, protected, or ambiguous are,
|
| 11 |
nonetheless, base classes. — *end note*]
|
| 12 |
|
| 13 |
For the purpose of defining the templates in this subclause, a function
|
| 14 |
call expression `declval<T>()` for any type `T` is considered to be a
|
| 15 |
trivial ([[basic.types]], [[special]]) function call that is not an
|
| 16 |
+
odr-use [[basic.def.odr]] of `declval` in the context of the
|
| 17 |
corresponding definition notwithstanding the restrictions of
|
| 18 |
[[declval]].
|
| 19 |
|
| 20 |
[*Example 1*:
|
| 21 |
|
|
|
|
| 46 |
To test() {
|
| 47 |
return declval<From>();
|
| 48 |
}
|
| 49 |
```
|
| 50 |
|
| 51 |
+
[*Note 2*: This requirement gives well-defined results for reference
|
| 52 |
types, void types, array types, and function types. — *end note*]
|
| 53 |
|
| 54 |
Access checking is performed in a context unrelated to `To` and `From`.
|
| 55 |
Only the validity of the immediate context of the *expression* of the
|
| 56 |
+
`return` statement [[stmt.return]] (including initialization of the
|
| 57 |
+
returned object or reference) is considered.
|
| 58 |
|
| 59 |
[*Note 3*: The initialization can result in side effects such as the
|
| 60 |
instantiation of class template specializations and function template
|
| 61 |
specializations, the generation of implicitly-defined functions, and so
|
| 62 |
on. Such side effects are not in the “immediate context” and can result
|