This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD status.
std::meta::reflect_constant_{string,array} talks about template parameter objects of built-in array typesSection: 21.4.3 [meta.define.static] Status: NAD Submitter: Jiang An Opened: 2025-11-25 Last modified: 2025-12-05
Priority: Not Prioritized
View all other issues in [meta.define.static].
View all issues with NAD status.
Discussion:
Currently, 21.4.3 [meta.define.static] is talking about template parameter objects of built-in array types,
but per 13.2 [temp.param]/13, a template parameter object must be of a class type. So
std::meta::reflect_constant_{string,array} are perhaps mis-specified.
[2025-11-27; Tomasz comments]
The template argument object defintion was extended to cover objects of array types by CWG 3111.
The usage of the term "template parameter object" is intentional here, as it guarantees that
reflect_constant_string produces the same objects, where their content is the same.
[2025-12-05 Status changed: New → NAD.]
Will be resolved by CWG 3111.
Proposed resolution:
This wording is relative to N5014.
Modify 21.4.3 [meta.define.static] as indicated:
template<ranges::input_range R> consteval info reflect_constant_string(R&& r);-2- Let
-3- Mandates:CharTberanges::range_value_t<R>.CharTis one ofchar,wchar_t,char8_t,char16_t,char32_t. -4- LetVbe the pack of values of typeCharTwhose elements are the corresponding elements ofr, except that ifrrefers to a string literal object, thenVdoes not include the trailing null terminator ofr. -5- LetPbethe template parameter object (13.2 [temp.param])of typeconst CharT[sizeof...(V) + 1]initialized with{V ..., CharT()}. […]template<ranges::input_range R> consteval info reflect_constant_array(R&& r);-8- Let
-9- Mandates:Tberanges::range_value_t<R>.Tis a structural type (13.2 [temp.param]), […]. -10- LetVbe the pack of values […]. -11- LetPbe
- (11.1) — If
sizeof...(V) > 0istrue, thenthe template parameter object (13.2 [temp.param])of typeconst T[sizeof...(V)]initialized with{[:V:]...}.- (11.2) — Otherwise, the template parameter object of type
array<T, 0>initialized with{}.[…]