C++ Logo

sg16

Advanced search

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

From: Peter Dimov <pdimov_at_[hidden]>
Date: Tue, 30 Apr 2024 18:55:29 +0300
Jens Maurer wrote:
> > It's a bit vague but std::cout is
> > https://eel.is/c++draft/narrow.stream.objects#3
> >
> > "The object cout controls output to a stream buffer associated with
> > the object stdout, declared in <cstdio>."
> >
> > which strongly implies a `filebuf` that writes to `stdout`, even
> > though it's not required to be literally that and can be e.g. of type
> __stdout_streambuf.
>
> A "filebuf" is not a std::fstream, and a "stream buffer" certainly is not
> necessarily a streambuf for a file.

Not necessarily, but `stdout` is a FILE*. So it's not an unreasonable
assumption.

> Where do we say this part in the standard, outside of the std::fstream
> specification?
>
> "the streambuf uses codecvt::out to transcode"

Nowhere. But isn't it a de-facto standard at this point?

Received on 2024-04-30 15:55:34