hash_map with string keys :"instantiated from here" error & STL questions

Paolo Carlini pcarlini@suse.de
Tue Aug 28 21:19:00 GMT 2007


Konstantinos Pachopoulos wrote:

> Hi,
> Greetings; that my first gcc post. Here's the code, that causes the error.

This is not the actual code: in general to have the attention of these 
lists you have to post a complete, self-contained, snippet, no ellipses.

In short (your question is more suited for gcc-help, the present list is 
about library development), there is only *one* C++ Standard in force, 
the ISO/IEC  Standard 14882:2003, which we are implementing to our best. 
In that standard there is no hash_map, for sure. We are still providing 
the legacy HP / SGI hashed containers but in order to use such 
containers with std::string you have to provide your own specialization 
of the hash struct (no mysteries, this is free software, just open 
ext/hash_fun.h). Alternately, move to the new unordered containers 
available via <tr1/unordered_map> and <tr1/unordered_set>, which will be 
also part of the forthcoming new standard in a very similar form.

Paolo.



More information about the Libstdc++ mailing list