21 Metaprogramming library [meta]

21.4 Reflection [meta.reflection]

21.4.14 Promoting to static storage arrays [meta.reflection.array]

The functions in this subclause promote compile-time storage into static storage.
template<ranges::input_range R> consteval info reflect_constant_string(R&& r);
Let CharT be ranges​::​range_value_t<R>.
Mandates: CharT is one of char, wchar_t, char8_t, char16_t, char32_t.
Let V be the pack of values of type CharT whose elements are the corresponding elements of r, except that if r refers to a string literal object, then V does not include the trailing null terminator of r.
Let P be the template parameter object ([temp.param]) of type const CharT[sizeof...(V)+1] initialized with V..., CHART().
Returns: ^^P.
[Note 1: 
P is a potentially non-unique object ([intro.object]).
— end note]
template<ranges::input_range R> consteval info reflect_constant_array(R&& r);
Let T be ranges​::​range_value_t<R>.
Mandates: T is a structural type ([temp.param]), is_constructible_v<T, ranges​::​range_reference_t<R>> is true, and is_copy_constructible_v<T> is true.
Constant When: reflect_constant(e) is a constant subexpression for every element e of r.
Let V be the pack of values of type info of the same size as r, where the element is reflect_constant(), where is the element of r.
Let P be
  • If sizeof...(V) > 0 is true, then the template parameter object ([temp.param]) of type const T[sizeof...(V)] initialized with {[:V:]...}.
  • Otherwise, the template parameter object of type array<T, 0> initialized with {}.
Returns: ^^P.
[Note 2: 
P is a potentially non-unique object ([intro.object]).
— end note]