1 // Copyright (c) 2009-2016 Vladimir Batov. 2 // Use, modification and distribution are subject to the Boost Software License, 3 // Version 1.0. See http://www.boost.org/LICENSE_1_0.txt. 4 5 #ifndef BOOST_CONVERT_DETAIL_IS_STRING_HPP 6 #define BOOST_CONVERT_DETAIL_IS_STRING_HPP 7 8 #include <boost/convert/detail/range.hpp> 9 10 namespace boost { namespace cnv 11 { 12 namespace detail 13 { 14 template<typename T, bool is_range_class> struct is_string : std::false_type {}; 15 16 template<typename T> struct is_string<T*, false> 17 { 18 static bool const value = cnv::is_char<T>::value; 19 }; 20 template <typename T, std::size_t N> struct is_string<T [N], false> 21 { 22 static bool const value = cnv::is_char<T>::value; 23 }; 24 template<typename T> struct is_string<T, /*is_range_class=*/true> 25 { 26 static bool const value = cnv::is_char<typename T::value_type>::value; 27 }; 28 } 29 template<typename T> struct is_string : detail::is_string< 30 typename boost::remove_const<T>::type, 31 boost::is_class<T>::value && boost::cnv::is_range<T>::value> {}; 32 }} 33 34 #endif // BOOST_CONVERT_DETAIL_IS_STRING_HPP 35