From Jason Turner

[meta.rel]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmplj4ptu27/{from.md → to.md} +11 -3
tmp/tmplj4ptu27/{from.md → to.md} RENAMED
@@ -1,14 +1,22 @@
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
  For the purpose of defining the templates in this subclause, a function
11
  call expression `declval<T>()` for any type `T` is considered to be a
12
  trivial [[term.trivial.type]], [[special]] function call that is not an
13
  odr-use [[term.odr.use]] of `declval` in the context of the
14
  corresponding definition notwithstanding the restrictions of 
@@ -43,19 +51,19 @@ implicit conversions to the return type of the function:
43
  To test() {
44
  return declval<From>();
45
  }
46
  ```
47
 
48
- [*Note 1*: This requirement gives well-defined results for reference
49
  types, array types, function types, and cv `void`. — *end note*]
50
 
51
  Access checking is performed in a context unrelated to `To` and `From`.
52
  Only the validity of the immediate context of the *expression* of the
53
  `return` statement [[stmt.return]] (including initialization of the
54
  returned object or reference) is considered.
55
 
56
- [*Note 2*: The initialization can result in side effects such as the
57
  instantiation of class template specializations and function template
58
  specializations, the generation of implicitly-defined functions, and so
59
  on. Such side effects are not in the “immediate context” and can result
60
  in the program being ill-formed. — *end note*]
61
 
 
1
  ### Relationships between types <a id="meta.rel">[[meta.rel]]</a>
2
 
3
+ The templates specified in [[meta.rel]] 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
+ Let `ELEMS-OF(T)` be the parameter pack `get<N>(declval<T>())`, where
11
+ *`N`* is the pack of `size_t` template arguments of the specialization
12
+ of `index_sequence` denoted by
13
+ `make_index_sequence<tuple_size_v<remove_reference_t<T>>>`.
14
+
15
+ [*Note 1*: Virtual base classes that are private, protected, or
16
+ ambiguous are, nonetheless, virtual base classes. — *end note*]
17
+
18
  For the purpose of defining the templates in this subclause, a function
19
  call expression `declval<T>()` for any type `T` is considered to be a
20
  trivial [[term.trivial.type]], [[special]] function call that is not an
21
  odr-use [[term.odr.use]] of `declval` in the context of the
22
  corresponding definition notwithstanding the restrictions of 
 
51
  To test() {
52
  return declval<From>();
53
  }
54
  ```
55
 
56
+ [*Note 2*: This requirement gives well-defined results for reference
57
  types, array types, function types, and cv `void`. — *end note*]
58
 
59
  Access checking is performed in a context unrelated to `To` and `From`.
60
  Only the validity of the immediate context of the *expression* of the
61
  `return` statement [[stmt.return]] (including initialization of the
62
  returned object or reference) is considered.
63
 
64
+ [*Note 3*: The initialization can result in side effects such as the
65
  instantiation of class template specializations and function template
66
  specializations, the generation of implicitly-defined functions, and so
67
  on. Such side effects are not in the “immediate context” and can result
68
  in the program being ill-formed. — *end note*]
69