This is the mail archive of the libstdc++@sources.redhat.com 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]

Re: hash_map<> and string...


Benjamin Kosnik <bkoz@redhat.com> writes:

| > | I suspect this will get you where you want to go. If not, you're
| > | pretty much out of luck, as only fundamental types are going in this
| > | file, apparently.
| > 
| > Well, any reasonable hash table library should come with a hash
| > function for fundmantal types or nearby types (i.e. pointer types).
| > It is also understandable to require the library to come with hash
| > functions defined for any type it happens to define or use, for
| > completeness purpose.
| 
| I see we disagree about what is "reasonable." I think this is OK though.

:-) There is no portable way (from a user point of view) to provide a
hash function for a pointer type, that is why I find it "reasonable"
to provide hash functions for type types.  I agree for integer types
the matter is debatable, but for floating point types, I thing that is
best handled by the library.

| > It is not really hard to add support for hash<std::string> but that has
| > a low priority on my TODO list.  And if we start providing support
| > for std::string, there is no reason we should stop there... 
| 
| Right. It's this bit that concerns me. Let's not go down this path...

So, what do we do? :-)

-- Gaby
CodeSourcery, LLC                       http://www.codesourcery.com

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