This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Tue, Aug 28, 2007 at 11:57:01PM +0300, Konstantinos Pachopoulos wrote:
> Hi,
> Greetings; that my first gcc post. Here's the code, that causes the error.

>        //maps currency names(ISO namings) to a specific row and column 
>        //of the matrix (row_num==col_num)
>        hash_map<string,int> fProductToId_;

> 1/I got an answer, that the error has to do with hash_map not being able 
> to handle string objects. First, can somebody confirm that?

You need to define a hash function for strings.  Then it will work.

> 2/I read somewhere, that hash_map is not "standard". What does this 
> mean? Doesn't libstdc++ implement the sgi STL "standard"?

The libstdc++ hash_map comes from the SGI STL implementation, but it
was not accepted as part of the C++ standard.  It's an extension,
though a widely available one.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]