C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::wprint/std::wprintln

From: Jan Schultke <janschultke_at_[hidden]>
Date: Sun, 30 Mar 2025 13:20:37 +0200
I don't really see a reason why std::print for wide strings shouldn't
exist. Wide strings already exist and std::wcout already exists, and
they are required to work. std::format can also output std::wstrings
already.

It seems somewhat arbitrary that std::format can produce wide strings,
but std::print can't, even though the standard library provides
facilities for printing them. The problems with unclear encoding are
the same for char and wchar_t as well. They're equally cursed; neither
is guaranteed to be UTF-8 or UTF-16 or whatever.

This made me wonder why std::print doesn't already support std::print
with wide strings, and the answer is in P2093R14:

> Adding charN_t and wchar_t overloads will be explored in a separate paper in a more general context.

Uh huh ... sure it will

Received on 2025-03-30 11:20:51