From Jason Turner

[temp.dep.splice]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpdop6qqh5/{from.md → to.md} +45 -0
tmp/tmpdop6qqh5/{from.md → to.md} RENAMED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Dependent splice specifiers <a id="temp.dep.splice">[[temp.dep.splice]]</a>
2
+
3
+ A *splice-specifier* is dependent if its converted *constant-expression*
4
+ is value-dependent. A *splice-specialization-specifier* is dependent if
5
+ its *splice-specifier* is dependent or if any of its template arguments
6
+ are dependent. A *splice-scope-specifier* is dependent if its
7
+ *splice-specifier* or *splice-specialization-specifier* is dependent.
8
+
9
+ [*Example 1*:
10
+
11
+ ``` cpp
12
+ template<auto T, auto NS>
13
+ void fn() {
14
+ using a = [:T:]<1>; // [:T:]<1> is dependent because [:T:] is dependent
15
+ static_assert([:NS:]::template TCls<1>::v == a::v); // [:NS:] is dependent
16
+ }
17
+
18
+ namespace N {
19
+ template <auto V> struct TCls { static constexpr int v = V; };
20
+ }
21
+
22
+ int main() {
23
+ fn<^^N::TCls, ^^N>();
24
+ }
25
+ ```
26
+
27
+ — *end example*]
28
+
29
+ [*Example 2*:
30
+
31
+ ``` cpp
32
+ template<template<class> class X>
33
+ struct S {
34
+ [:^^X:]<int, float> m;
35
+ };
36
+
37
+ template<class> struct V1 {};
38
+ template<class, class = int> struct V2 {};
39
+
40
+ S<V1> s1; // error: V1<int, float> has too many template arguments
41
+ S<V2> s2; // OK
42
+ ```
43
+
44
+ — *end example*]
45
+