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_CONST_ITERATOR_HPP |
| 12 | #define NDNBOOST_RANGE_DETAIL_CONST_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 | ////////////////////////////////////////////////////////////////////////////// |
| 18 | // missing partial specialization workaround. |
| 19 | ////////////////////////////////////////////////////////////////////////////// |
| 20 | |
| 21 | namespace ndnboost |
| 22 | { |
| 23 | namespace range_detail |
| 24 | { |
| 25 | template< typename T > |
| 26 | struct range_const_iterator_; |
| 27 | |
| 28 | template<> |
| 29 | struct range_const_iterator_<std_container_> |
| 30 | { |
| 31 | template< typename C > |
| 32 | struct pts |
| 33 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 34 | typedef NDNBOOST_RANGE_DEDUCED_TYPENAME C::const_iterator type; |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 35 | }; |
| 36 | }; |
| 37 | |
| 38 | template<> |
| 39 | struct range_const_iterator_<std_pair_> |
| 40 | { |
| 41 | template< typename P > |
| 42 | struct pts |
| 43 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 44 | typedef NDNBOOST_RANGE_DEDUCED_TYPENAME P::first_type type; |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 45 | }; |
| 46 | }; |
| 47 | |
| 48 | |
| 49 | template<> |
| 50 | struct range_const_iterator_<array_> |
| 51 | { |
| 52 | template< typename T > |
| 53 | struct pts |
| 54 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 55 | typedef const NDNBOOST_RANGE_DEDUCED_TYPENAME |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 56 | remove_extent<T>::type* type; |
| 57 | }; |
| 58 | }; |
| 59 | } |
| 60 | |
| 61 | template< typename C > |
| 62 | class range_const_iterator |
| 63 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 64 | typedef NDNBOOST_DEDUCED_TYPENAME range_detail::range<C>::type c_type; |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 65 | public: |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 66 | typedef NDNBOOST_DEDUCED_TYPENAME range_detail::range_const_iterator_<c_type>::NDNBOOST_NESTED_TEMPLATE pts<C>::type type; |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 67 | }; |
| 68 | |
| 69 | } |
| 70 | |
| 71 | #endif |