This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
iostream bug with fixed
- To: egcs-bugs at cygnus dot com
- Subject: iostream bug with fixed
- From: Erik Andersen <andersen at inconnect dot com>
- Date: Tue, 10 Nov 1998 00:47:55 -0700
- Reply-To: andersen at inconnect dot com
I currently have libstdc++ with egcs-2.91.58 from 19981101. I notice
the following:
I have some C++ code like this:
#include <iostream>
using namespace std;
...
template <class T>
std::ostream& operator<<(std::ostream &s, const HMatrix<T> &A)
{
...
s << fixed << setw(10) << setprecision(3) << A[i][j] << " ";
...
}
This code works with MS VC++ 5.0. With egcs though I see:
homogmat.h:411: `fixed' undeclared (first use this function)
homogmat.h:411: (Each undeclared identifier is reported only once
homogmat.h:411: for each function it appears in.)
make: *** [mattest.o] Error 1
Changing the function to:
s.setf(_IO_FIXED);
s << setw(10) << setprecision(3) << A[i][j] << " ";
causes the expected fixed (non-scientific numbers) behavior.
-Erik
--
Erik B. Andersen Web: http://www.inconnect.com/~andersen/
email: andersee@debian.org
--This message was written using 73% post-consumer electrons--