S
sschnug
Hello,
my program is using much hash-based lookups of int vectors (size 1-3).
I don't know which hash function Boost is using, but i wanted to try
fnv1 (maybe faster, maybe less collisions).
The Boost documentation says:
__________________________
For example, if you wanted to use the FNV-1 hash you could write:
boost::unordered_map<std::string, int, hash::fnv_1>
dictionary;
There is an implementation of FNV-1 in the examples directory.
____________________________________________________
Okay, but after including fnv1.hpp from the examples directory and
using the sytax above, compiler is printing out the error:
3-Hitting-Set.cpp:80: error: reference to 'hash' is ambiguous
C:\Program Files\boost\boost_1_36_0\libs\unordered\examples\fnv1.hpp:
13: error:
candidates are: namespace hash { }
c:\codeblocks\mingw\bin\../lib/gcc/mingw32/4.3.2/../../../../include/
boost/funct
ional/hash_fwd.hpp:23: error: template<class T> struct
boost::ha
sh
3-Hitting-Set.cpp:80: error: template argument 2 is invalid
3-Hitting-Set.cpp:80: error: invalid type in declaration before ';'
token
3-Hitting-Set.cpp:95: error: request for member 'insert' in 'edges',
which is of
non-class type 'int'
Renaming namespace doesn't work either.
Any ideas?
Thank you very much.
Greetings
Sascha
my program is using much hash-based lookups of int vectors (size 1-3).
I don't know which hash function Boost is using, but i wanted to try
fnv1 (maybe faster, maybe less collisions).
The Boost documentation says:
__________________________
For example, if you wanted to use the FNV-1 hash you could write:
boost::unordered_map<std::string, int, hash::fnv_1>
dictionary;
There is an implementation of FNV-1 in the examples directory.
____________________________________________________
Okay, but after including fnv1.hpp from the examples directory and
using the sytax above, compiler is printing out the error:
3-Hitting-Set.cpp:80: error: reference to 'hash' is ambiguous
C:\Program Files\boost\boost_1_36_0\libs\unordered\examples\fnv1.hpp:
13: error:
candidates are: namespace hash { }
c:\codeblocks\mingw\bin\../lib/gcc/mingw32/4.3.2/../../../../include/
boost/funct
ional/hash_fwd.hpp:23: error: template<class T> struct
boost::ha
sh
3-Hitting-Set.cpp:80: error: template argument 2 is invalid
3-Hitting-Set.cpp:80: error: invalid type in declaration before ';'
token
3-Hitting-Set.cpp:95: error: request for member 'insert' in 'edges',
which is of
non-class type 'int'
Renaming namespace doesn't work either.
Any ideas?
Thank you very much.
Greetings
Sascha