Commit 61460d8d authored by Martin Bauer's avatar Martin Bauer

Merge branch 'hash' into 'master'

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

See merge request !221
parents eb1fd933 0ac522f2
Pipeline #17205 canceled with stages
in 74 minutes and 6 seconds
...@@ -381,3 +381,15 @@ namespace mpi ...@@ -381,3 +381,15 @@ namespace mpi
} // namespace walberla } // 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 { ...@@ -1689,3 +1689,15 @@ namespace walberla {
}; };
} // 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 ...@@ -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