// Copyright 2017, 2018 Peter Dimov. // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #ifndef BOOST_HASH_IS_CONTIGUOUS_RANGE_HPP_INCLUDED #define BOOST_HASH_IS_CONTIGUOUS_RANGE_HPP_INCLUDED #include #include #include #include #if !BOOST_WORKAROUND(BOOST_MSVC, < 1910) #include namespace boost { namespace hash_detail { template std::integral_constant< bool, std::is_same::value_type, T>::value && std::is_integral::value > is_contiguous_range_check( It first, It last, T const*, T const*, S ); template decltype( is_contiguous_range_check( std::declval().begin(), std::declval().end(), std::declval().data(), std::declval().data() + std::declval().size(), std::declval().size() ) ) is_contiguous_range_( int ); template std::false_type is_contiguous_range_( ... ); template struct is_contiguous_range: decltype( hash_detail::is_contiguous_range_( 0 ) ) { }; } // namespace hash_detail namespace container_hash { template struct is_contiguous_range: std::integral_constant< bool, is_range::value && hash_detail::is_contiguous_range::value > { }; } // namespace container_hash } // namespace boost #else // !BOOST_WORKAROUND(BOOST_MSVC, < 1910) #include #include #include #include namespace boost { namespace container_hash { template struct is_contiguous_range: std::false_type { }; template struct is_contiguous_range< std::basic_string >: std::true_type { }; template struct is_contiguous_range< std::basic_string const >: std::true_type { }; template struct is_contiguous_range< std::vector >: std::true_type { }; template struct is_contiguous_range< std::vector const >: std::true_type { }; template struct is_contiguous_range< std::vector >: std::false_type { }; template struct is_contiguous_range< std::vector const >: std::false_type { }; template struct is_contiguous_range< std::array >: std::true_type { }; template struct is_contiguous_range< std::array const >: std::true_type { }; } // namespace container_hash } // namespace boost #endif // !BOOST_WORKAROUND(BOOST_MSVC, < 1910) #endif // #ifndef BOOST_HASH_IS_CONTIGUOUS_RANGE_HPP_INCLUDED