std::meta::reflect_constant_string - cppreference.com
From cppreference.com
template< ranges::input_range R > consteval std::meta::info reflect_constant_string( R&& r ); |
(since C++26) | |
Returns a reflection that represents a character array object whose elements are corresponding elements of r, with a null character appended if r is not a string literal object.
The resulting character array object is a template parameter object: it has static storage duration, and strings with the same contents correspond to the same object.
The resulting character array object is also a potentially non-unique object.
Formally, let:
CharTberanges::range_value_t<R>, which must be one ofchar,wchar_t,char8_t,char16_t, orchar32_t.Vbe the pack of values of typeCharT, whose elements are corresponding elements ofr, except that ifris a string literal object,Vdoes not include the terminating null character ofr.Pbe the template parameter object of typeconst CharT[sizeof...(V) + 1], initialized with{V..., CharT()}.
This function returns a reflection that represents the object P.
Parameters
Return value
A reflection that represents a character array object, as described above.
Notes
The result of std::meta::reflect_constant_string is suitable for use with std::meta::substitute. If the caller wants a pointer to a static string, as opposite to a reflection value, std::define_static_string is usually more suitable.