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_DETAIL_ITERATOR_HPP |
| 12 | #define NDNBOOST_RANGE_DETAIL_ITERATOR_HPP |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 13 | |
| 14 | #include <ndnboost/range/detail/common.hpp> |
| 15 | #include <ndnboost/range/detail/remove_extent.hpp> |
| 16 | |
| 17 | #include <ndnboost/static_assert.hpp> |
| 18 | |
| 19 | ////////////////////////////////////////////////////////////////////////////// |
| 20 | // missing partial specialization workaround. |
| 21 | ////////////////////////////////////////////////////////////////////////////// |
| 22 | |
| 23 | namespace ndnboost |
| 24 | { |
| 25 | namespace range_detail |
| 26 | { |
| 27 | template< typename T > |
| 28 | struct range_iterator_ { |
| 29 | template< typename C > |
| 30 | struct pts |
| 31 | { |
| 32 | typedef int type; |
| 33 | }; |
| 34 | }; |
| 35 | |
| 36 | template<> |
| 37 | struct range_iterator_<std_container_> |
| 38 | { |
| 39 | template< typename C > |
| 40 | struct pts |
| 41 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 42 | typedef NDNBOOST_RANGE_DEDUCED_TYPENAME C::iterator type; |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 43 | }; |
| 44 | }; |
| 45 | |
| 46 | template<> |
| 47 | struct range_iterator_<std_pair_> |
| 48 | { |
| 49 | template< typename P > |
| 50 | struct pts |
| 51 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 52 | typedef NDNBOOST_RANGE_DEDUCED_TYPENAME P::first_type type; |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 53 | }; |
| 54 | }; |
| 55 | |
| 56 | template<> |
| 57 | struct range_iterator_<array_> |
| 58 | { |
| 59 | template< typename T > |
| 60 | struct pts |
| 61 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 62 | typedef NDNBOOST_RANGE_DEDUCED_TYPENAME |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 63 | remove_extent<T>::type* type; |
| 64 | }; |
| 65 | }; |
| 66 | |
| 67 | } |
| 68 | |
| 69 | template< typename C > |
| 70 | class range_mutable_iterator |
| 71 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 72 | typedef NDNBOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type c_type; |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 73 | public: |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 74 | typedef typename range_detail::range_iterator_<c_type>::NDNBOOST_NESTED_TEMPLATE pts<C>::type type; |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 75 | }; |
| 76 | } |
| 77 | |
| 78 | #endif |