C++ Logo

sg16

Advanced search

Re: [isocpp-sg16] Follow up on SG16 review of P2996R2 (Reflection for C++26)

From: Peter Dimov <pdimov_at_[hidden]>
Date: Thu, 9 May 2024 16:32:48 +0300
Tiago Freire wrote:
>
> > > Are we talking about different things?
> > Yes, probably. I don't see how you can claim the things you claim, because
> it's pretty obvious that if you insert "foo", u8"foo", and L"foo" into the same
> stream, you can't avoid transcoding at least two of these three times.
>
> I agree, you must transcode at least 2 of them, what I'm arguing is that you
> don't need a third intermediate encoding to do so. Only the input and output
> are relevant.

But there's no single "input", there are three. You have to transcode to a
single encoding which to pass to the stream buffer, and that single encoding
is the intermediate one.

So having fixed UTF-8 as that one single encoding has the advantages of being
fixed (at compile time) and being able to represent each of the input three.

Having it variable and runtime-dependent... does not.

Received on 2024-05-09 13:32:53