- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
struct S { struct Inner { }; };
template<int N> struct X;
auto refl = ˆS;
auto tmpl = ˆX;
void f() {
typename [:refl:] * x; // OK: declares x to be a pointer-to-S
[:refl:] * x; // error: attempt to multiply int by x
[:refl:]::Inner i; // OK: splice as part of a nested-name-specifier
typename [:refl:]{}; // OK: default-constructs an S temporary
using T = [:refl:]; // OK: operand must be a type
struct C : [:refl:] {}; // OK: base classes are types
template [:tmpl:]<0>; // OK: names the specialization
[:tmpl:] < 0 > x; // error: attempt to compare X with 0
}