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