Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 1 | // Boost.Range library |
| 2 | // |
| 3 | // Copyright Thorsten Ottosen 2003-2004. Use, modification and |
| 4 | // distribution is subject to the Boost Software License, Version |
| 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 6 | // http://www.boost.org/LICENSE_1_0.txt) |
| 7 | // |
| 8 | // For more information, see http://www.boost.org/libs/range/ |
| 9 | // |
| 10 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 11 | #ifndef NDNBOOST_RANGE_ITERATOR_HPP |
| 12 | #define NDNBOOST_RANGE_ITERATOR_HPP |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 13 | |
| 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) |
| 15 | # pragma once |
| 16 | #endif |
| 17 | |
| 18 | #include <ndnboost/range/config.hpp> |
| 19 | #include <ndnboost/range/mutable_iterator.hpp> |
| 20 | #include <ndnboost/range/const_iterator.hpp> |
| 21 | #include <ndnboost/type_traits/is_const.hpp> |
| 22 | #include <ndnboost/type_traits/remove_const.hpp> |
| 23 | #include <ndnboost/mpl/eval_if.hpp> |
| 24 | |
| 25 | namespace ndnboost |
| 26 | { |
| 27 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 28 | #if NDNBOOST_WORKAROUND(NDNBOOST_MSVC, == 1310) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 29 | |
| 30 | namespace range_detail_vc7_1 |
| 31 | { |
| 32 | template< typename C, typename Sig = void(C) > |
| 33 | struct range_iterator |
| 34 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 35 | typedef NDNBOOST_RANGE_DEDUCED_TYPENAME |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 36 | mpl::eval_if_c< is_const<C>::value, |
| 37 | range_const_iterator< typename remove_const<C>::type >, |
| 38 | range_mutable_iterator<C> >::type type; |
| 39 | }; |
| 40 | |
| 41 | template< typename C, typename T > |
| 42 | struct range_iterator< C, void(T[]) > |
| 43 | { |
| 44 | typedef T* type; |
| 45 | }; |
| 46 | } |
| 47 | |
| 48 | #endif |
| 49 | |
| 50 | template< typename C > |
| 51 | struct range_iterator |
| 52 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 53 | #if NDNBOOST_WORKAROUND(NDNBOOST_MSVC, == 1310) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 54 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 55 | typedef NDNBOOST_RANGE_DEDUCED_TYPENAME |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 56 | range_detail_vc7_1::range_iterator<C>::type type; |
| 57 | |
| 58 | #else |
| 59 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 60 | typedef NDNBOOST_RANGE_DEDUCED_TYPENAME |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 61 | mpl::eval_if_c< is_const<C>::value, |
| 62 | range_const_iterator< typename remove_const<C>::type >, |
| 63 | range_mutable_iterator<C> >::type type; |
| 64 | |
| 65 | #endif |
| 66 | }; |
| 67 | |
| 68 | } // namespace ndnboost |
| 69 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 70 | //#endif // NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 71 | |
| 72 | #endif |