strange warning when importing template from namespace

S

Simon Anders

Hi,

just a little question:

I'm using the hash_set template from the GNU C++ standard library.
Because the hashed containers are not standard content of the library
but an extension taken over from SGI, the GNU people have put them into
a special namespace __gnu_cxx.

So I wrote:

#include <ext/hash_set>
using __gnu_cxx::hash_set;
[...]
typedef hash_set<VertexIndex>::iterator VtxIdxIter;
[...]

Although this works fine, I get a compiler warning, namely:

stabilizer.h:12: Warning(315): Nothing known about
'__gnu_cxx::hash_set'.

(with line 12 being the 'using' statement).

What is the compiler trying to warn me about, i.e. what would it like to
know? As all works fine, I wonder when it would not have worked.

TIA,
Simon
 
V

Victor Bazarov

Simon said:
Hi,

just a little question:

I'm using the hash_set template from the GNU C++ standard library.
Because the hashed containers are not standard content of the library
but an extension taken over from SGI, the GNU people have put them into
a special namespace __gnu_cxx.

So I wrote:

#include <ext/hash_set>
using __gnu_cxx::hash_set;
[...]
typedef hash_set<VertexIndex>::iterator VtxIdxIter;

try

typedef typename hash_set said:
[...]

Although this works fine, I get a compiler warning, namely:

stabilizer.h:12: Warning(315): Nothing known about
'__gnu_cxx::hash_set'.

(with line 12 being the 'using' statement).

What is the compiler trying to warn me about, i.e. what would it like to
know? As all works fine, I wonder when it would not have worked.

I am not sure what specifically that compiler is warning you about, you
would need to ask in gnu.g++.help. Does it know what 'VertexIndex' is
at the time when it sees the typedef?

Victor
 
J

Jari Kalevi Savolainen

Hi,

just a little question:

I'm using the hash_set template from the GNU C++ standard library.
Because the hashed containers are not standard content of the library
but an extension taken over from SGI, the GNU people have put them into
a special namespace __gnu_cxx.

So I wrote:

#include <ext/hash_set>
using __gnu_cxx::hash_set;
[...]
typedef hash_set<VertexIndex>::iterator VtxIdxIter;
[...]

Although this works fine, I get a compiler warning, namely:

stabilizer.h:12: Warning(315): Nothing known about
'__gnu_cxx::hash_set'.

(with line 12 being the 'using' statement).

What is the compiler trying to warn me about, i.e. what would it like to
know? As all works fine, I wonder when it would not have worked.

TIA,
Simon

Identifiers starting with ___s are often used internally by compilers. It
might warn about that.

Try and look for an alias for that namespace.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top