C++ Logo

std-discussion

Advanced search

Re: IOStreams behavior definition

From: Ronan Keryell <rkeryell_at_[hidden]>
Date: Tue, 30 Jun 2020 17:46:38 +0000
On 6/30/20 10:01 AM, Philip Prindeville via Std-Discussion wrote:

> Hi.

Hi Philip!

> I'm trying to figure out what the appropriate behavior of std::setw() and std::ios_base::width() should be on a istream. It doesn't seem to be well defined.

This is quite possible. :-)

> You'd think this would be a fairly common/obvious usage scenario but it doesn't seem to be well defined in the IOStreams specification.

It is not clear which part of the specification document you are
referring precisely.

> http://www.cplusplus.com/reference/iomanip/setw/
>
> Refers to both input and output streams but only describes output behavior concretely.
>
> http://www.cplusplus.com/reference/ios/ios_base/width/
>
> Its homologue width() on the other hand makes no mention of input at all.
>
> Can some clarity be shed on this?

We cannot clarify all the websites talking about C++ on the Internet. :-)

This mailing-list is about discussing the ISO C++ standard itself more
than answering end-user questions. Perhaps places like
https://stackoverflow.com/questions/tagged/c%2b%2b are more responsive
for your question.

Personally I find http://www.cplusplus.com quite obsolete compared to
https://en.cppreference.com/w/ in the same domain. Perhaps it might
answer your question if you dive into it.

See you,
--
Ronan KERYELL, Xilinx Research Labs / San José, California.

Received on 2020-06-30 12:49:51