C++ Logo

sg16

Advanced search

Re: Follow up on SG16 review of P2996R2 (Reflection for C++26)

From: Peter Dimov <pdimov_at_[hidden]>
Date: Sat, 4 May 2024 03:49:05 +0300
Tom Honermann wrote:
> Characters should be handled as well as strings:
>
>
> template<class charT, class traits>
> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>&
> out, char8_t);
> template<class charT, class traits>
> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>&
> out, char16_t);
> template<class charT, class traits>
> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>&
> out, char32_t);

I don't think the first one of these makes any sense. It's not possible to transcode
a char8_t on its own.

char32_t can work. char16_t is borderline if we don't go outside the BMP.

I wouldn't shed any tears if we just disallow all three for consistency.

Received on 2024-05-04 00:49:10