Is std::tr1::unordered_map supposed to be working yet?
Thu Aug 18 11:04:00 GMT 2005

Paul C. Leopardi wrote:

>Two related questions.
>1. Is the difference in interface between __gnu_cxx::hash_map and 
>std::tr1::unordered_map documented anywhere? Does the fact that I can't find 
>any such gcc - specific documentation mean that std::tr1::unordered_map is a 
>trivial drop-in replacement for __gnu_cxx::hash_map ?
Unfortunatly it's not. There isn't explicit differences documented
either. Documentation for tr1::unordered_map is contained in

If you get a copy of the complete g++ source code, then look in
libstdc++-v3/testsuite/tr1/6_containers/ you'll find the testsuite for
the unordered containers, which should at least show the basics of how
they work, although I'll admit not documented.

>2. I've been trying to use std::tr1::unordered_map as a replacement for 
>__gnu_cxx::hash_map, with gcc version 4.0.2 20050728 (prerelease), and have 
>encountered errors. Is this mailing list the correct place to check to see if 
>I am using std::tr1::unordered_map correctly, and to check that it should 
>work with gcc version 4.0.2 20050728 (prerelease)?
I believe it is, although it's fairly new, so don't be too suprised if
you don't get too many replies :) Unfortunatly, as I say, it's not
designed as a drop-in replacement. It would definatly be advisable to
move toward using it however, as except in extreme cases bug reports for
__gnu_cxx::hash_map are being ignored, and it's going to be phased out
in the not-too-distant future. Any problems with tr1::unordered_map have
a much better change of being fixed :)


More information about the Gcc-help mailing list