1// Copyright 2017 Peter Dimov.
2// Distributed under the Boost Software License, Version 1.0.
3// https://www.boost.org/LICENSE_1_0.txt
4
5#ifndef BOOST_HASH_IS_UNORDERED_RANGE_HPP_INCLUDED
6#define BOOST_HASH_IS_UNORDERED_RANGE_HPP_INCLUDED
7
8#include <boost/container_hash/is_range.hpp>
9#include <boost/type_traits/integral_constant.hpp>
10#include <boost/type_traits/is_same.hpp>
11
12namespace boost
13{
14namespace hash_detail
15{
16
17template<class T, class E = true_type> struct has_hasher_: false_type
18{
19};
20
21template<class T> struct has_hasher_< T, integral_constant< bool,
22 is_same<typename T::hasher, typename T::hasher>::value
23 > >: true_type
24{
25};
26
27} // namespace hash_detail
28
29namespace container_hash
30{
31
32template<class T> struct is_unordered_range: integral_constant< bool, is_range<T>::value && hash_detail::has_hasher_<T>::value >
33{
34};
35
36} // namespace container_hash
37} // namespace boost
38
39#endif // #ifndef BOOST_HASH_IS_UNORDERED_RANGE_HPP_INCLUDED
40