Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / November 2005



Tip: Looking for answers? Try searching our database.

gcc deal with namespace in a wrong way

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Huang.Antony@gmail.com - 30 Nov 2005 11:59 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.

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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.