Date: Sun, 5 Dec 2021 20:26:49 +0100
On 05/12/2021 01.04, Tom Honermann wrote:
> On 12/4/21 6:05 AM, Jens Maurer wrote:
>> If we impose a requirement for a code unit -> code point decoder for the
>> literal encoding at compile-time, we should make such a facility generally
>> available instead of hiding it in the guts of the std::format parser.
> I think JeanHeyd's work on P1629 <https://wg21.link/p1629> will fill this niche. It would be nice if the features he proposes in N2730 <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2730.htm> were usable at compile-time as well, but that will likely have to await some kind of constexpr support in C.
Why? We've made functions constexpr that are inherited from C
before.
>>> It makes me wonder if some of these features should be restricted to u8 formatting strings 😅
>> We even have a "u8" string literal prefix to indicate UTF-8 string literals.
>> What a foresight.
>
> Perhaps some day we'll even be able to pass such strings to std::format()!
We can't be so modern.
Jens
> On 12/4/21 6:05 AM, Jens Maurer wrote:
>> If we impose a requirement for a code unit -> code point decoder for the
>> literal encoding at compile-time, we should make such a facility generally
>> available instead of hiding it in the guts of the std::format parser.
> I think JeanHeyd's work on P1629 <https://wg21.link/p1629> will fill this niche. It would be nice if the features he proposes in N2730 <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2730.htm> were usable at compile-time as well, but that will likely have to await some kind of constexpr support in C.
Why? We've made functions constexpr that are inherited from C
before.
>>> It makes me wonder if some of these features should be restricted to u8 formatting strings 😅
>> We even have a "u8" string literal prefix to indicate UTF-8 string literals.
>> What a foresight.
>
> Perhaps some day we'll even be able to pass such strings to std::format()!
We can't be so modern.
Jens
Received on 2021-12-05 13:26:58