Commit 0ac522f2 authored by Michael Kuron's avatar Michael Kuron 🔬

specialize std::hash<T> for Cell, Vector2, Vector3

This was lost in the migration from boost to std as boost::hash<T> (and thus boost::unordered_map<T,V>) uses hash_value<T> if available and std::hash<T> (and thus std::unordered_map<T,V>) does not.
parent 4f97ea03
Pipeline #17061 passed with stages
in 229 minutes and 34 seconds
......@@ -381,3 +381,15 @@ namespace mpi
} // namespace walberla
namespace std
{
template<>
struct hash< walberla::Cell >
{
std::size_t operator()( walberla::Cell const & cell ) const noexcept
{
return walberla::cell::hash_value( cell );
}
};
} // namespace std
......@@ -1689,3 +1689,15 @@ namespace walberla {
};
} // namespace walberla
namespace std
{
template<typename T>
struct hash< walberla::Vector2<T> >
{
std::size_t operator()( walberla::Vector2<T> const & v ) const noexcept
{
return walberla::Vector2<T>::hash_value( v );
}
};
} // namespace std
......@@ -1969,3 +1969,15 @@ inline bool check_float_equal_eps( const math::Vector3<real_t> & lhs, const math
}
}
}
namespace std
{
template<typename T>
struct hash< walberla::Vector3<T> >
{
std::size_t operator()( walberla::Vector3<T> const & v ) const noexcept
{
return walberla::Vector3<T>::hash_value( v );
}
};
} // namespace std
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment