Created on 2025-10-21.00:00:00 last changed 1 month ago
Proposed resolution:
This wording is relative to N5014.
Modify [meta.reflection.array] as indicated:
template<ranges::input_range R> consteval info reflect_constant_string(R&& r);-2- Let `CharT` be
ranges::range_value_t<R>.-3- 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`
refersis a reference to a string literal object, then V does not include thetrailing null terminatorterminating u+0000 null character of `r`.
[ Kona 2025-11-08; Status changed: Voting → WP. ]
[ 2025-10-23; Reflector poll. ]
Set status to Tentatively Ready after six votes in favour during reflector poll.
`meta::reflect_constant_string` says:
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`.It's unclear how the implementation should decide whether `r` refers to a string literal. If `R` models `contiguous_iterator`, should it use `meta::is_string_literal(ranges::data(r))`? Should it omit the `'\0'` from `string_view("abc", 3)`?
Also, "null terminator" is only defined in [basic.string.general] and not used for string literal objects ([lex.string]).
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-11-11 10:48:16 | admin | set | messages: + msg15661 |
| 2025-11-11 10:48:16 | admin | set | status: voting -> wp |
| 2025-10-30 17:45:31 | admin | set | status: ready -> voting |
| 2025-10-27 10:00:32 | admin | set | messages: + msg15457 |
| 2025-10-27 10:00:32 | admin | set | status: new -> ready |
| 2025-10-21 12:18:32 | admin | set | messages: + msg15303 |
| 2025-10-21 00:00:00 | admin | create | |