Help on __gnu_cxx::hash_map

S

Srinu

Hi,

Is there any document regarding "__gnu_cxx::hash_map"?
I want to know how to use it.

Srinivas
 
M

Maxim Yegorushkin

Hi,

Is there any document regarding "__gnu_cxx::hash_map"?
I want to know how to use it.

Srinivas

__gnu_cxx::hash_map follows the interface of std::map<> plus extra
functions. Try looking in <ext/hash_map> header, it is pretty
self-documenting.
 
S

Srinu

Thanks max. I read the file you suggested. It is well written. But is
there any document telling how to use this hash_map?

Srinivas
 
F

Francesco S. Carta

Thanks max. I read the file you suggested. It is well written. But is
there any document telling how to use this hash_map?

Its interface and its usage are pretty much the same of the std::map, as
Maxim pointed out. Once you get to understand how to use the std::map,
the hash_map will be practically the same.

If you want, you can search for further information and for the
"synthesized" interface starting from the following link - so you don't
have to wander through the implementation code:

http://gcc.gnu.org/onlinedocs/libstdc++/
 
J

Jorgen Grahn

Many thanks for this...

The SGI documentation is better, I think:
<http://www.sgi.com/tech/stl/>.

hash_map was in the pre-standard STL, didn't make it into standard C++,
but was offered as an extension in e.g. libstdc++.

std::tr1::unordered_map /is/ standardized and similar to hash_map, but
there are subtle differences (iterator invalidation, IIRC).

If all your environments already have it, I'd use std::tr1::unordered_map
instead in new code.

/Jorgen
 

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
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top