Chris@16
|
1 /*
|
Chris@16
|
2 [auto_generated]
|
Chris@16
|
3 boost/numeric/odeint/util/detail/is_range.hpp
|
Chris@16
|
4
|
Chris@16
|
5 [begin_description]
|
Chris@16
|
6 is_range implementation. Taken from the boost::range library.
|
Chris@16
|
7 [end_description]
|
Chris@16
|
8
|
Chris@101
|
9 Copyright 2011-2013 Karsten Ahnert
|
Chris@101
|
10 Copyright 2011-2013 Thorsten Ottosen
|
Chris@16
|
11
|
Chris@16
|
12
|
Chris@16
|
13
|
Chris@16
|
14 Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
15 (See accompanying file LICENSE_1_0.txt or
|
Chris@16
|
16 copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
17 */
|
Chris@16
|
18
|
Chris@16
|
19
|
Chris@16
|
20 #ifndef BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED
|
Chris@16
|
21 #define BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED
|
Chris@16
|
22
|
Chris@16
|
23
|
Chris@16
|
24 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
Chris@16
|
25 # pragma once
|
Chris@16
|
26 #endif
|
Chris@16
|
27
|
Chris@16
|
28 #include <cstddef>
|
Chris@16
|
29 #include <boost/range/config.hpp>
|
Chris@16
|
30 #include <boost/mpl/has_xxx.hpp>
|
Chris@16
|
31 #include <boost/mpl/bool.hpp>
|
Chris@16
|
32 #include <boost/mpl/and.hpp>
|
Chris@16
|
33
|
Chris@16
|
34 namespace boost {
|
Chris@16
|
35 namespace numeric {
|
Chris@16
|
36 namespace odeint {
|
Chris@16
|
37
|
Chris@16
|
38
|
Chris@16
|
39
|
Chris@16
|
40 namespace range_detail
|
Chris@16
|
41 {
|
Chris@16
|
42 BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator)
|
Chris@16
|
43 BOOST_MPL_HAS_XXX_TRAIT_DEF(const_iterator)
|
Chris@16
|
44 }
|
Chris@16
|
45
|
Chris@16
|
46 namespace detail
|
Chris@16
|
47 {
|
Chris@16
|
48
|
Chris@16
|
49 template< typename Range >
|
Chris@16
|
50 struct is_range : boost::mpl::and_<range_detail::has_iterator<Range>, range_detail::has_const_iterator<Range> >
|
Chris@16
|
51 {
|
Chris@16
|
52 };
|
Chris@16
|
53
|
Chris@16
|
54 //////////////////////////////////////////////////////////////////////////
|
Chris@16
|
55 // pair
|
Chris@16
|
56 //////////////////////////////////////////////////////////////////////////
|
Chris@16
|
57
|
Chris@16
|
58 template< typename iteratorT >
|
Chris@16
|
59 struct is_range< std::pair<iteratorT,iteratorT> > : boost::mpl::true_
|
Chris@16
|
60 {
|
Chris@16
|
61 };
|
Chris@16
|
62
|
Chris@16
|
63 template< typename iteratorT >
|
Chris@16
|
64 struct is_range< const std::pair<iteratorT,iteratorT> > : boost::mpl::true_
|
Chris@16
|
65 {
|
Chris@16
|
66 };
|
Chris@16
|
67
|
Chris@16
|
68 //////////////////////////////////////////////////////////////////////////
|
Chris@16
|
69 // array
|
Chris@16
|
70 //////////////////////////////////////////////////////////////////////////
|
Chris@16
|
71
|
Chris@16
|
72 template< typename elementT, std::size_t sz >
|
Chris@16
|
73 struct is_range< elementT[sz] > : boost::mpl::true_
|
Chris@16
|
74 {
|
Chris@16
|
75 };
|
Chris@16
|
76
|
Chris@16
|
77 template< typename elementT, std::size_t sz >
|
Chris@16
|
78 struct is_range< const elementT[sz] > : boost::mpl::true_
|
Chris@16
|
79 {
|
Chris@16
|
80 };
|
Chris@16
|
81
|
Chris@16
|
82 //////////////////////////////////////////////////////////////////////////
|
Chris@16
|
83 // string
|
Chris@16
|
84 //////////////////////////////////////////////////////////////////////////
|
Chris@16
|
85
|
Chris@16
|
86 template<>
|
Chris@16
|
87 struct is_range< char* > : boost::mpl::true_
|
Chris@16
|
88 {
|
Chris@16
|
89 };
|
Chris@16
|
90
|
Chris@16
|
91 template<>
|
Chris@16
|
92 struct is_range< wchar_t* > : boost::mpl::true_
|
Chris@16
|
93 {
|
Chris@16
|
94 };
|
Chris@16
|
95
|
Chris@16
|
96 template<>
|
Chris@16
|
97 struct is_range< const char* > : boost::mpl::true_
|
Chris@16
|
98 {
|
Chris@16
|
99 };
|
Chris@16
|
100
|
Chris@16
|
101 template<>
|
Chris@16
|
102 struct is_range< const wchar_t* > : boost::mpl::true_
|
Chris@16
|
103 {
|
Chris@16
|
104 };
|
Chris@16
|
105
|
Chris@16
|
106 template<>
|
Chris@16
|
107 struct is_range< char* const > : boost::mpl::true_
|
Chris@16
|
108 {
|
Chris@16
|
109 };
|
Chris@16
|
110
|
Chris@16
|
111 template<>
|
Chris@16
|
112 struct is_range< wchar_t* const > : boost::mpl::true_
|
Chris@16
|
113 {
|
Chris@16
|
114 };
|
Chris@16
|
115
|
Chris@16
|
116 template<>
|
Chris@16
|
117 struct is_range< const char* const > : boost::mpl::true_
|
Chris@16
|
118 {
|
Chris@16
|
119 };
|
Chris@16
|
120
|
Chris@16
|
121 template<>
|
Chris@16
|
122 struct is_range< const wchar_t* const > : boost::mpl::true_
|
Chris@16
|
123 {
|
Chris@16
|
124 };
|
Chris@16
|
125
|
Chris@16
|
126 } // namespace detail
|
Chris@16
|
127
|
Chris@16
|
128 } // namespace odeint
|
Chris@16
|
129 } // namespace numeric
|
Chris@16
|
130 } // namespace boost
|
Chris@16
|
131
|
Chris@16
|
132
|
Chris@16
|
133
|
Chris@16
|
134 #endif // BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED
|