Hi, I found gcc3.3 deal with namespace in a wrong way. Follow is my
code snip. BTW, I compile this code with gcc3.3 under mac OS10.3.
I didn't use statement of 'using namespace std;', but gcc think my
variant 'fill' is conflict with 'std::fill()'. Is it wrong that gcc
have done?
int fill;
struct foo{int foo;};
#include <vector>
void test(void)
{
vector< foo > vt;
vt.resize(2);
}
gcc saying(amongst other things),
error: `fill' is not a function,
/usr/include/g++/bits/stl_algobase.h:561: error: conflict with `void
std::fill(char*, char*, const char&)'
I'd appreciate for any advice on the issue.
Tony
Clark S. Cox III - 30 Nov 2005 16:44 GMT
> Hi, I found gcc3.3 deal with namespace in a wrong way. Follow is my
> code snip. BTW, I compile this code with gcc3.3 under mac OS10.3.
[quoted text clipped - 24 lines]
>
> Tony
You probably haven't seen my reply on comp.lang.c++.moderated, as there
is a moderation delay, but Yes, this is a bug in GCC. You can fix this
by upgrading to a later version of GCC (I believe that it was fixed in
3.4, but I know for a fact that it was fixed by 4.0.1, as your code
compiles fine on my Mac)

Signature
Clark S. Cox, III
clarkcox3@gmail.com