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.
> 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