This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]