is_unordered_range.hpp 914 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. #ifndef BOOST_HASH_IS_UNORDERED_RANGE_HPP_INCLUDED
  5. #define BOOST_HASH_IS_UNORDERED_RANGE_HPP_INCLUDED
  6. #include <boost/container_hash/is_range.hpp>
  7. #include <type_traits>
  8. namespace boost
  9. {
  10. namespace hash_detail
  11. {
  12. template<class T, class E = std::true_type> struct has_hasher_: std::false_type
  13. {
  14. };
  15. template<class T> struct has_hasher_< T, std::integral_constant< bool,
  16. std::is_same<typename T::hasher, typename T::hasher>::value
  17. > >: std::true_type
  18. {
  19. };
  20. } // namespace hash_detail
  21. namespace container_hash
  22. {
  23. template<class T> struct is_unordered_range: std::integral_constant< bool, is_range<T>::value && hash_detail::has_hasher_<T>::value >
  24. {
  25. };
  26. } // namespace container_hash
  27. } // namespace boost
  28. #endif // #ifndef BOOST_HASH_IS_UNORDERED_RANGE_HPP_INCLUDED