StevenLOL / sparsehash

Automatically exported from code.google.com/p/sparsehash
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Does not recognize hash template #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile Sample program from dense_hash_set

What is the expected output? What do you see instead?
Does not compile

What version of the product are you using? On what operating system?
1.1 on Ubuntu Linux x86 Hardy Heron 8.04

Please provide any additional information below.
The compiler says that hash was not declared in this scope.  The header is 
being recognized properly but it is not recognizing hash in the line:

dense_hash_set<const char*, hash<const char*>, eqstr> Set;

Original issue reported on code.google.com by johansen...@gmail.com on 9 Aug 2008 at 11:11

GoogleCodeExporter commented 9 years ago
hash<> is not part of the STL standard, and is defined in a different namespace 
in
different STL implementations.  You'll need to figure out the right namespace 
for
your implementation.

In the next release of sparsehash, I will try to clarify that the example may 
not
work out of the box on all distributions, due to namespace issues.

Original comment by csilv...@gmail.com on 10 Aug 2008 at 6:37

GoogleCodeExporter commented 9 years ago
For ubuntu linux just add
using __gnu_cxx::hash;

to the list of namespaces

Original comment by fabrizio...@gmail.com on 17 Aug 2008 at 11:50

GoogleCodeExporter commented 9 years ago
Thanks, I'll mention that in the next version of the documentation

Original comment by csilv...@gmail.com on 19 Aug 2008 at 1:32

GoogleCodeExporter commented 9 years ago
Fixed in sparsehash 1.2, just released.

Original comment by csilv...@gmail.com on 19 Sep 2008 at 7:23