This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: g++ sometimes doesn't find its standard headers
- From: LLeweLLyn Reese <llewelly at lifesupport dot shutdown dot com>
- To: Markus Gerwinski <markus at gerwinski dot de>
- Cc: Andres Chavarria <el_andrecillo at hotmail dot com>, gcc-help at gcc dot gnu dot org
- Date: 13 Mar 2003 06:31:39 -0800
- Subject: Re: g++ sometimes doesn't find its standard headers
- References: <F120BQ8CLGGTgXMtW8r00014662@hotmail.com><20030313100204.GA6157@leia.local>
- Reply-to: gcc-help at gcc dot gnu dot org
Markus Gerwinski <markus at gerwinski dot de> writes:
> Andres Chavarria wrote:
> > using namespace std;
> > vector<int> vec;
> >
> > or
> >
> > #include <vector>
> > std::vector<int> vec;
>
> Well, <vector>, <string> etc. are running fine with that, but my problem was
> with <ext/hash_map>. As I meanwhile found out, the hash_map class is not inside
> the std namespace, but inside some cryptic namespace "__gnu_cxx". If I use that
> one, it works fine, but "__gnu_cxx" doesn't really seem to be a namespace for
> public use. ;-)
>
> Does someone know if I really should use this one? Or is there maybe some
> #define deep inside gcc3.2 transferring this cryptic namespace into something
> else, that's intended for use by the app developer?
The name __gnu_cxx is intended to inform the app developer (you) that
a gnu extension is in use. It begins with __ because names
begining with __ are reserved to the implementation; conforming
user code can be assumed not to use __gnu_cxx, except to
deliberate use the extensions. See:
gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-3.1/namespace____gnu__cxx.html#_details
The maintainers are aware that the situation is confusing. :-)