Error in stl_bvector.h and vector.tcc
Theodore Papadopoulo
Theodore.Papadopoulo@sophia.inria.fr
Wed Jun 9 17:42:00 GMT 2004
sabba.hillel@verizon.net said:
> The following code causes gcc-3.4.0 to find a compile error in
> stl_bvector.h and vector.tcc
>
> [ Code elided ]
>
> If the vector line is moved before the max, min definitions, the error
> does not occur. if the fstream include is removed, the error does not
> occur.
Without even trying to compile your code, I can tell you that
defining macros whose names are min and max is asking for trouble.
There are some std::min and std::max functions and the headers
defining those are certainly included somehow by vector and fstream.
so instead of std::max(i,j) you got std::( ((i) > (j)) ? (i) : (j) )
This occurs a few times in vector.
Why it does not occur if you remove the fstream is more puzzling. I
suspect that stl_algo.h (where the min and max c++ function are
defined, undefines your definitions for min and max and that what the
error disappears...
Theo.
--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
--------------------------------------------------------------------
More information about the Gcc
mailing list