Is std::tr1::unordered_map supposed to be working yet?

random@bubblescope.net random@bubblescope.net
Thu Aug 18 17:09:00 GMT 2005


Paul C. Leopardi wrote:

>Hi Chris,
>Thanks for your reply. My responses are below.
>Best, Paul
>On Thu, 18 Aug 2005 08:56 pm, random@bubblescope.net wrote:
>  
>
>>Paul C. Leopardi wrote:
>>    
>>
>>>Hi,
>>>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
>>http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1745.pdf
>>
>>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.
>>    
>>
>
>Thanks. I took a look at the documentation for TR1 and the source code. The 
>tests don't look like they test std::tr1::unordered_map< K, T >, where K is a 
>user defined class. All the tests look like they use std::string for K.
>So maybe std::tr1::unordered_map< K, T > is not supposed to work?
>
>AFAICT, since I have a user defined key class K, I need to define my own 
>hash< K > class. I did this and now have a strange compilation error message.
>
>  
>
Hmm.. looks like they are actually seriously badly tested..

For example, just

std::tr1::unordered_set<int> i,j;
i=j;
fails to compile!

I'll submit that as a bug, and it should get fixed. Looks like they are
somewhat less tested than I thought :)



More information about the Gcc-help mailing list