// Boost.Range library // // Copyright Thorsten Ottosen 2003-2004. Use, modification and // distribution is subject to the Boost Software License, Version // 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // For more information, see http://www.boost.org/libs/range/ // #ifndef BOOST_RANGE_IS_RANGE_HPP #define BOOST_RANGE_IS_RANGE_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif #include #include #include #include #include namespace boost { ////////////////////////////////////////////////////////////////////////// // default ////////////////////////////////////////////////////////////////////////// namespace range_detail { BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator) BOOST_MPL_HAS_XXX_TRAIT_DEF(const_iterator) } template< typename Range > struct is_range : boost::mpl::and_, range_detail::has_const_iterator > { }; ////////////////////////////////////////////////////////////////////////// // pair ////////////////////////////////////////////////////////////////////////// template< typename iteratorT > struct is_range< std::pair > : boost::mpl::true_ { }; template< typename iteratorT > struct is_range< const std::pair > : boost::mpl::true_ { }; ////////////////////////////////////////////////////////////////////////// // array ////////////////////////////////////////////////////////////////////////// template< typename elementT, std::size_t sz > struct is_range< elementT[sz] > : boost::mpl::true_ { }; template< typename elementT, std::size_t sz > struct is_range< const elementT[sz] > : boost::mpl::true_ { }; ////////////////////////////////////////////////////////////////////////// // string ////////////////////////////////////////////////////////////////////////// template<> struct is_range< char* > : boost::mpl::true_ { }; template<> struct is_range< wchar_t* > : boost::mpl::true_ { }; template<> struct is_range< const char* > : boost::mpl::true_ { }; template<> struct is_range< const wchar_t* > : boost::mpl::true_ { }; template<> struct is_range< char* const > : boost::mpl::true_ { }; template<> struct is_range< wchar_t* const > : boost::mpl::true_ { }; template<> struct is_range< const char* const > : boost::mpl::true_ { }; template<> struct is_range< const wchar_t* const > : boost::mpl::true_ { }; } // namespace boost #endif