// 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 #include #if !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_SFINAE_EXPR) && !BOOST_WORKAROUND(BOOST_GCC, < 40700) && !BOOST_WORKAROUND(BOOST_MSVC, < 1910) #include #include #include #include namespace boost { namespace hash_detail { template integral_constant< bool, is_same::value_type, T>::value && is_integral::value > is_contiguous_range_check( It first, It last, T const*, T const*, S ); template decltype( is_contiguous_range_check( declval().begin(), declval().end(), declval().data(), declval().data() + declval().size(), declval().size() ) ) is_contiguous_range_( int ); template 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: integral_constant< bool, is_range::value && hash_detail::is_contiguous_range::value > { }; } // namespace container_hash } // namespace boost #else // !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_SFINAE_EXPR) #include #include #include #if !defined(BOOST_NO_CXX11_HDR_ARRAY) #include #endif namespace boost { namespace container_hash { template struct is_contiguous_range: false_type { }; template struct is_contiguous_range< std::basic_string >: true_type { }; template struct is_contiguous_range< std::basic_string const >: true_type { }; #if !defined(BOOST_NO_CXX11_HDR_ARRAY) template struct is_contiguous_range< std::array >: true_type { }; template struct is_contiguous_range< std::array const >: true_type { }; #endif } // namespace container_hash } // namespace boost #endif // !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_SFINAE_EXPR) #endif // #ifndef BOOST_HASH_IS_CONTIGUOUS_RANGE_HPP_INCLUDED