This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
hash_map with unsigned long long keys
- From: Martin Beaudoin <beaudoin dot martin at ireq dot ca>
- To: libstdc++ at gcc dot gnu dot org
- Date: Wed, 01 Oct 2003 10:20:17 -0400
- Subject: hash_map with unsigned long long keys
- Organization: Hydro-Quebec - IREQ
Hello,
I need to use a hash_map with unsigned long long keys.
Currently, this type of key is not supported by libstdc++.
I would like to propose the following addition to the file
gcc/libstdc++-v3/include/ext/hash_fun.h:
---------------------------------------------------------------------------------
template<> struct hash<long long> {
size_t operator()(long long __x) const { return __x; }
};
template<> struct hash<const long long> {
size_t operator()(const long long __x) const { return __x; }
};
template<> struct hash<unsigned long long> {
size_t operator()(unsigned long long __x) const { return __x; }
};
template<> struct hash<const unsigned long long> {
size_t operator()(const unsigned long long __x) const { return __x; }
};
----------------------------------------------------------------------------------
This simple addition on my local development system gave me the expected
functionnality currently missing with g++ hash_maps.
Thank you.
--
Martin Beaudoin