3 boost/numeric/odeint/util/detail/is_range.hpp
6 is_range implementation. Taken from the boost::range library.
9 Copyright 2011-2013 Karsten Ahnert
10 Copyright 2011-2013 Thorsten Ottosen
14 Distributed under the Boost Software License, Version 1.0.
15 (See accompanying file LICENSE_1_0.txt or
16 copy at http://www.boost.org/LICENSE_1_0.txt)
20 #ifndef BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED
21 #define BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED
24 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
29 #include <boost/range/config.hpp>
30 #include <boost/mpl/has_xxx.hpp>
31 #include <boost/mpl/bool.hpp>
32 #include <boost/mpl/and.hpp>
40 namespace range_detail
42 BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator)
43 BOOST_MPL_HAS_XXX_TRAIT_DEF(const_iterator)
49 template< typename Range >
50 struct is_range : boost::mpl::and_<range_detail::has_iterator<Range>, range_detail::has_const_iterator<Range> >
54 //////////////////////////////////////////////////////////////////////////
56 //////////////////////////////////////////////////////////////////////////
58 template< typename iteratorT >
59 struct is_range< std::pair<iteratorT,iteratorT> > : boost::mpl::true_
63 template< typename iteratorT >
64 struct is_range< const std::pair<iteratorT,iteratorT> > : boost::mpl::true_
68 //////////////////////////////////////////////////////////////////////////
70 //////////////////////////////////////////////////////////////////////////
72 template< typename elementT, std::size_t sz >
73 struct is_range< elementT[sz] > : boost::mpl::true_
77 template< typename elementT, std::size_t sz >
78 struct is_range< const elementT[sz] > : boost::mpl::true_
82 //////////////////////////////////////////////////////////////////////////
84 //////////////////////////////////////////////////////////////////////////
87 struct is_range< char* > : boost::mpl::true_
92 struct is_range< wchar_t* > : boost::mpl::true_
97 struct is_range< const char* > : boost::mpl::true_
102 struct is_range< const wchar_t* > : boost::mpl::true_
107 struct is_range< char* const > : boost::mpl::true_
112 struct is_range< wchar_t* const > : boost::mpl::true_
117 struct is_range< const char* const > : boost::mpl::true_
122 struct is_range< const wchar_t* const > : boost::mpl::true_
126 } // namespace detail
128 } // namespace odeint
129 } // namespace numeric
134 #endif // BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED