forked from boostorg/container_hash
Move std::pair support into hash.hpp
This commit is contained in:
@@ -32,18 +32,6 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <class A, class B>
|
||||
std::size_t hash_value(std::pair<A, B> const&);
|
||||
|
||||
template <class A, class B>
|
||||
std::size_t hash_value(std::pair<A, B> const& v)
|
||||
{
|
||||
std::size_t seed = 0;
|
||||
boost::hash_combine(seed, v.first);
|
||||
boost::hash_combine(seed, v.second);
|
||||
return seed;
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_TUPLE)
|
||||
namespace hash_detail {
|
||||
template <std::size_t I, typename T>
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
#include <complex>
|
||||
#include <utility>
|
||||
#include <climits>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
|
||||
@@ -167,6 +168,19 @@ namespace boost
|
||||
return seed;
|
||||
}
|
||||
|
||||
// pair
|
||||
|
||||
template <class A, class B>
|
||||
std::size_t hash_value( std::pair<A, B> const& v )
|
||||
{
|
||||
std::size_t seed = 0;
|
||||
|
||||
boost::hash_combine( seed, v.first );
|
||||
boost::hash_combine( seed, v.second );
|
||||
|
||||
return seed;
|
||||
}
|
||||
|
||||
// ranges (list, set, deque...)
|
||||
|
||||
template <typename T>
|
||||
|
Reference in New Issue
Block a user