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

Jon Gjerde Jon.Gjerde@nr.no
Tue Jan 7 13:36:00 GMT 2003


The following reply was made to PR libstdc++/9215; it has been noted by GNATS.

From: "Jon Gjerde" <Jon.Gjerde@nr.no>
To: <paolo@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>,
        <jon.gjerde@nr.no>, <nobody@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: c++/9215: Problem with reserting a stream to default using setf
Date: Tue, 7 Jan 2003 14:29:07 +0100

 ----- 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
 
 



More information about the Gcc-prs mailing list