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


----- Original Message -----
From: <paolo@gcc.gnu.org>
To: <gcc-bugs@gcc.gnu.org>; <gcc-prs@gcc.gnu.org>; <jon.gjerde@nr.no>;
<nobody@gcc.gnu.org>; <paolo@gcc.gnu.org>
Sent: Tuesday, January 07, 2003 1:48 PM
Subject: Re: c++/9215: Problem with reserting a stream to default using setf


> Synopsis: Problem with reserting a stream to default using setf
>
> Responsible-Changed-From-To: unassigned->paolo
> Responsible-Changed-By: paolo
> Responsible-Changed-When: Tue Jan  7 04:48:30 2003
> Responsible-Changed-Why:
>     Analyzed.
> State-Changed-From-To: open->feedback
> State-Changed-By: paolo
> State-Changed-When: Tue Jan  7 04:48:30 2003
> State-Changed-Why:
>     Basing on the ISO standard, what you are trying to do is not
>     portable across different implementations. On the contrary
>
>       cout.setf(ios_base::floatfield, ios_base::floatfield);
>
>     it is and works for me.
>     Works for you?
>     Thanks, Paolo.
>
>
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
r=9215
>

Thank you for the quick reply.

Is your solution cout.setf(ios_base::floatfield, ios_base::floatfield) equal
to unsetf(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.

Yours, Jon Gjerde



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