mirror of https://github.com/CGAL/cgal
Make Triple hashable
This commit is contained in:
parent
d48cd2c5f2
commit
7ce7a68cd0
|
|
@ -30,6 +30,7 @@
|
|||
#include <CGAL/config.h>
|
||||
#include <utility>
|
||||
#include <functional>
|
||||
#include <boost/functional/hash.hpp>
|
||||
|
||||
// The Triple and Quadruple classes are NOT RECOMMENDED anymore.
|
||||
// We recommend that you use cpp11::tuple or cpp11::array instead
|
||||
|
|
@ -128,6 +129,17 @@ public:
|
|||
return internal::Tuple_get<i, Self>::get(*this);
|
||||
}
|
||||
|
||||
|
||||
friend std::size_t hash_value(Triple<T1,T2,T3> const& t)
|
||||
{
|
||||
std::size_t seed = 0;
|
||||
boost::hash_combine(seed, t.first);
|
||||
boost::hash_combine(seed, t.second);
|
||||
boost::hash_combine(seed, t.third);
|
||||
|
||||
return seed;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
template <class T1, class T2, class T3>
|
||||
|
|
|
|||
Loading…
Reference in New Issue