This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
older setfs sintax to newer g++ 3.0.2
- To: gcc-help at gcc dot gnu dot org
- Subject: older setfs sintax to newer g++ 3.0.2
- From: Giuseppe Zompatori <joesunny at tiscalinet dot it>
- Date: Wed, 31 Oct 2001 22:32:56 -0500
Hi there,
I'd greatly appreciate any help with changing the following old code(ca. 1997)
to the new ISO standards.
<snip>
ostream &operator<<(ostream &io,const Cone &d)
{
io.setf(ios::showpoint+ios::right+ios::fixed);
io << "Cone " << d.height << " " << d.radius << " " << d.thetamin << "-" <<
d.thetamax << " " << d.zmin << "-" << d.zmax << "\n";
return io;
}
</snip>
gcc 3.0.2 fails with the following error:
g++-3.0.2 -c -W -ansi -O3 -mcpu=i586 -march=i586 -fomit-frame-pointer
-ffast-math -malign-double -fpack-struct -fno-exceptions -fno-rtti cone.cpp -o
cone.o -I. -Isurface_shaders -Idisplacement_shaders -Ilight_shaders
cone.cpp: In function `std::ostream& operator<<(std::ostream&, const Cone&)':
cone.cpp:50: no matching function for call to `std::basic_ostream<char,
std::char_traits<char> >::setf(int)'
/usr/include/g++-v3/bits/ios_base.h:323: candidates are: std::_Ios_Fmtflags
std::ios_base::setf(std::_Ios_Fmtflags)
/usr/include/g++-v3/bits/ios_base.h:331: std::_Ios_Fmtflags
std::ios_base::setf(std::_Ios_Fmtflags, std::_Ios_Fmtflags)
make: *** [cone.o] Error 1
What's the new sintax for setf?
I am not able to determinate it by myself as I am not even an hacker.
Again any help greatly appreciated.
Thanks in advance,
Giuseppe