is_tuple_like.hpp 835 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef BOOST_HASH_IS_TUPLE_LIKE_HPP_INCLUDED
  2. #define BOOST_HASH_IS_TUPLE_LIKE_HPP_INCLUDED
  3. // Copyright 2017, 2022 Peter Dimov.
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // https://www.boost.org/LICENSE_1_0.txt
  6. #include <type_traits>
  7. #include <utility>
  8. namespace boost
  9. {
  10. namespace hash_detail
  11. {
  12. template<class T, class E = std::true_type> struct is_tuple_like_: std::false_type
  13. {
  14. };
  15. template<class T> struct is_tuple_like_<T, std::integral_constant<bool, std::tuple_size<T>::value == std::tuple_size<T>::value> >: std::true_type
  16. {
  17. };
  18. } // namespace hash_detail
  19. namespace container_hash
  20. {
  21. template<class T> struct is_tuple_like: hash_detail::is_tuple_like_< typename std::remove_cv<T>::type >
  22. {
  23. };
  24. } // namespace container_hash
  25. } // namespace boost
  26. #endif // #ifndef BOOST_HASH_IS_TUPLE_LIKE_HPP_INCLUDED