This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
hash_map<char*,T> default EqualKey
- To: libstdc++ at gcc dot gnu dot org
- Subject: hash_map<char*,T> default EqualKey
- From: Marco Morandini <morandini at aero dot polimi dot it>
- Date: Mon, 21 May 2001 14:07:21 +0200
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