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]

hash_map<char*,T> default EqualKey


As pointed out in 

http://gcc.gnu.org/ml/gcc-bugs/1998-02/msg00383.html

while hash_map<char*,T> has a default has_function
which is based on the contents of the string,
its equality function defaults to equal_key<char*>, which is based
on the address of the string and not on his contents.
I found this quite misleading.
Would not be better to have equal_to<char*> (as well as
not_equal_to, greater, less, greater_equal and less_equal) specialized
with strcmp and not leave this to the user?
Will this break something else?

Thanks,

Marco Morandini


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