I am trying to compile a project on my mac, which is originally written on linux. It went smoothly on archlinux but has a lot of errors on mac. Especially, I'm very confused with this error message:
In file included from /Users/STW/Documents/neuroblaze/nb/tagged_index/tagged_index.t.hpp:4:
/Users/STW/Documents/neuroblaze/nb/tagged_index/tagged_index.hpp:425:26: error:
implicit instantiation of undefined template 'std::hash<unsigned long>'
::std::hash<IndexType> hasher;
^
And here is the relevant code:(tagged_index.hpp)
namespace std {
/**
* tagged_index can be hashed. Just forwards the hash to the contained type.
*
* @ingroup TaggedIndex
*/
template <typename UniquenessTag, typename IndexType,
typename ConstructorFunction>
struct hash<tsb::tagged_index<UniquenessTag, IndexType, ConstructorFunction>> {
using value_type =
tsb::tagged_index<UniquenessTag, IndexType, ConstructorFunction>;
::std::hash<IndexType> hasher;
size_t operator()(const value_type& l) const { return hasher(l); }
};
/**
* tagged_offset can be hashed. Just forwards the hash to the contained type.
*
* @ingroup TaggedOffset
*/
template <typename UniquenessTag, typename IndexType,
typename ConstructorFunction>
struct hash<tsb::tagged_offset<UniquenessTag, IndexType, ConstructorFunction>> {
using value_type =
tsb::tagged_offset<UniquenessTag, IndexType, ConstructorFunction>;
::std::hash<IndexType> hasher;
size_t operator()(const value_type& l) const { return hasher(l); }
};
} // end namespace std
I have included functional in this hpp file.