This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9215: Problem with reserting a stream to default using setf
- From: "Jon Gjerde" <Jon dot Gjerde at nr dot no>
- To: <paolo at gcc dot gnu dot org>, <gcc-bugs at gcc dot gnu dot org>, <gcc-prs at gcc dot gnu dot org>, <jon dot gjerde at nr dot no>, <nobody at gcc dot gnu dot org>, <gcc-gnats at gcc dot gnu dot org>
- Date: Tue, 7 Jan 2003 14:29:07 +0100
- Subject: Re: c++/9215: Problem with reserting a stream to default using setf
- References: <20030107124834.10406.qmail@sources.redhat.com>
----- 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