c++/9215: Problem with reserting a stream to default using setf

Paolo Carlini pcarlini@unitus.it
Mon Jan 13 05:17:00 GMT 2003


Jon Gjerde wrote:

>Thank you for the quick reply.
>
>Is your solution cout.setf(ios_base::floatfield, ios_base::floatfield) equal
>to unsetf(ios_base::floatfield)?
>
Yes. An alternate solution would be

  cout.setf(ios_base::fmtflags(0), ios_base::floatfield)

>I am now using the latter, and it seems to
>do the same as setf(0, ios_base::floatfield) when using the Sun CC compiler.
>Btw, the setf(0, ios_base::floatfield) statement is taken from an example in
>The C++ Programming language by Bjarne Stroustrup.
>
;)

Well, I may be wrong, but in the _final_ standard I cannot find examples 
of a 'plain' 0 but always ios_base::fmtflags(0). Otherwise, make use of 
what I replied earlier today.

Barring any additional clarification on the '0' vs ios_base::fmtflags(0) 
issue, I would close the PR.

Ciao, Paolo.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9215




More information about the Gcc-bugs mailing list