Error in stl_bvector.h and vector.tcc
Hillel Markowitz (Sabba)
sabba.hillel@verizon.net
Wed Jun 9 21:02:00 GMT 2004
>
> From: Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
> Date: 2004/06/09 Wed PM 01:41:42 EDT
> To: Sabba.Hillel@verizon.net
> CC: pcarlini@suse.de, gdr@acm.org, gcc@gcc.gnu.org
> Subject: Re: Error in stl_bvector.h and vector.tcc
>
>
> 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.
Thank you. I knew that I was overlooking something obvious. I will remove the defines completely.
--
Said the fox to the fish, "Join me ashore."
The fish are the Jews, Torah is our water!
Hillel (Sabba) Markowitz
Sabba.Hillel@verizon.net, sabbahem@bcpl.net
More information about the Gcc
mailing list