This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: hash_map.find() use compiles on 64 bit but not on 32?
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: oleg <oleg at parascale dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Sun, 14 Dec 2008 10:08:25 +0100
- Subject: Re: hash_map.find() use compiles on 64 bit but not on 32?
- References: <49447562.8070704@parascale.com>
oleg wrote:
> the code included below seems to compile fine with gcc 4.1.2 on centos
> 5.2 on a 64 bit system. it fails to compile on a more or less
> identical 32 bit bit system. using map instead of hash_map allows it
> to work on both build platforms, but i'd rather use hash_map.
The error is simply due to the fact that the legacy hashed containers do
not provide an hashing function for int64_t, long long for your 32 bit
target. You can either provide it yourself, or move your code to the new
unordered containers, delivered as part of recent GCCs (4.3.x is the
current release branch, with 4.4.0 very close).
Paolo.