|
2746 | 2746 | consteval info data_member_spec(info type, data_member_options options);
|
2747 | 2747 | consteval bool is_data_member_spec(info r);
|
2748 | 2748 | template<@\libconcept{reflection_range}@ R = initializer_list<info>>
|
2749 |
| - consteval info define_aggregate(info type_class, R&&); |
| 2749 | + consteval info define_aggregate(info type_class, R&&); |
2750 | 2750 |
|
2751 | 2751 | // associated with \ref{meta.unary.cat}, primary type categories
|
2752 | 2752 | consteval bool is_void_type(info type);
|
|
2963 | 2963 | constexpr string_view sv = identifier_of(^^C);
|
2964 | 2964 | static_assert(sv == "C");
|
2965 | 2965 | static_assert(sv.data()[0] == 'C');
|
2966 |
| -%TODO: investigate if this is how we usually do backslashes in code blocks |
2967 |
| -static_assert(sv.data()[1] == '@\textbackslash@ 0'); |
| 2966 | +static_assert(sv.data()[1] == '@\textbackslash{}@0'); |
2968 | 2967 | \end{codeblock}
|
2969 | 2968 | \end{example}
|
2970 | 2969 |
|
|
3371 | 3370 | \effects
|
3372 | 3371 | Equivalent to:
|
3373 | 3372 | \begin{codeblock}
|
3374 |
| -return reflect_constant([: \placeholder{R} :]); |
| 3373 | +return reflect_constant([: @\placeholder{R}@ :]); |
3375 | 3374 | \end{codeblock}
|
3376 | 3375 | \begin{example}
|
3377 | 3376 | \begin{codeblock}
|
3378 | 3377 | constexpr int x = 0;
|
3379 | 3378 | constexpr int y = 0;
|
3380 | 3379 |
|
3381 |
| -static_assert(^^x != ^^y); // OK, \tcode{x} and \tcode{y} are different variables so their |
3382 |
| - // reflections compare different |
3383 |
| -static_assert(constant_of(^^x) == constant_of(^^y)); // OK, both \tcode{constant_of(x)} and |
3384 |
| - // \tcode{constant_of(\reflexpr{y})} |
3385 |
| - // represent the value \tcode{0} |
3386 |
| -static_assert(constant_of(^^x) == reflect_constant(0)); // OK, likewise |
| 3380 | +static_assert(^^x != ^^y); // OK, \tcode{x} and \tcode{y} are different variables, |
| 3381 | + // so their reflections compare different |
| 3382 | +static_assert(constant_of(^^x) == |
| 3383 | + constant_of(^^y)); // OK, both \tcode{constant_of(x)} and |
| 3384 | + // \tcode{constant_of(\reflexpr{y})} represent the value \tcode{0} |
| 3385 | +static_assert(constant_of(^^x) == |
| 3386 | + reflect_constant(0)); // OK, likewise |
3387 | 3387 |
|
3388 | 3388 | struct S { int m; };
|
3389 | 3389 | constexpr S s {42};
|
3390 | 3390 | static_assert(is_object(constant_of(^^s)) &&
|
3391 | 3391 | is_object(reflect_object(s)));
|
3392 |
| -static_assert(constant_of(^^s) != reflect_object(s)); // OK, template parameter object that is |
3393 |
| - // template-argument-equivalent to \tcode{s} is |
3394 |
| - // a different object than \tcode{s} |
| 3392 | +static_assert(constant_of(^^s) != // OK, template parameter object that is template-argument- |
| 3393 | + reflect_object(s)); // equivalent to \tcode{s} is a different object than \tcode{s} |
3395 | 3394 | static_assert(constant_of(^^s) ==
|
3396 |
| - constant_of(reflect_object(s))); // OK |
| 3395 | + constant_of(reflect_object(s))); // OK |
3397 | 3396 |
|
3398 | 3397 | consteval info fn() {
|
3399 | 3398 | constexpr int x = 42;
|
3400 | 3399 | return ^^x;
|
3401 | 3400 | }
|
3402 |
| -constexpr info r = constant_of(fn()); // error: \tcode{x} is outside its lifetime |
| 3401 | +constexpr info r = constant_of(fn()); // error: \tcode{x} is outside its lifetime |
3403 | 3402 | \end{codeblock}
|
3404 | 3403 | \end{example}
|
3405 | 3404 | \end{itemdescr}
|
|
4161 | 4160 | \end{itemize}
|
4162 | 4161 | \begin{example}
|
4163 | 4162 | \begin{codeblock}
|
4164 |
| -template<class T, class U=T> struct Pair { }; |
| 4163 | +template<class T, class U = T> struct Pair { }; |
4165 | 4164 | template<class T> struct Pair<char, T> { };
|
4166 | 4165 | template<class T> using PairPtr = Pair<T*>;
|
4167 | 4166 |
|
|
0 commit comments