From Jason Turner

[dcl.type.splice]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp8tl8dt_8/{from.md → to.md} +46 -0
tmp/tmp8tl8dt_8/{from.md → to.md} RENAMED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Type splicing <a id="dcl.type.splice">[[dcl.type.splice]]</a>
2
+
3
+ ``` bnf
4
+ splice-type-specifier:
5
+ typenameₒₚₜ splice-specifier
6
+ typenameₒₚₜ splice-specialization-specifier
7
+ ```
8
+
9
+ A *splice-specifier* or *splice-specialization-specifier* immediately
10
+ followed by `::` is never interpreted as part of a
11
+ *splice-type-specifier*. A *splice-specifier* or
12
+ *splice-specialization-specifier* not preceded by `typename` is only
13
+ interpreted as a *splice-type-specifier* within a type-only context
14
+ [[temp.res.general]].
15
+
16
+ [*Example 1*:
17
+
18
+ ``` cpp
19
+ template<std::meta::info R> void tfn() {
20
+ typename [:R:]::type m; // OK, typename applies to the qualified name
21
+ }
22
+
23
+ struct S { using type = int; };
24
+ void fn() {
25
+ [:^^S::type:] *var; // error: [:^^ S::type:] is an expression
26
+ typename [:^^S::type:] *var; // OK, declares variable with type int*
27
+ }
28
+
29
+ using alias = [:^^S::type:]; // OK, type-only context
30
+ ```
31
+
32
+ — *end example*]
33
+
34
+ For a *splice-type-specifier* of the form `typename`ₒₚₜ
35
+ *splice-specifier*, the *splice-specifier* shall designate a type, a
36
+ class template, or an alias template. The *splice-type-specifier*
37
+ designates the same entity as the *splice-specifier*.
38
+
39
+ For a *splice-type-specifier* of the form `typename`ₒₚₜ
40
+ *splice-specialization-specifier*, the *splice-specifier* of the
41
+ *splice-specialization-specifier* shall designate a template `T` that is
42
+ either a class template or an alias template. The
43
+ *splice-type-specifier* designates the specialization of `T`
44
+ corresponding to the template argument list of the
45
+ *splice-specialization-specifier*.
46
+