blob: 947b83ec9f0b742e8568d158b376acf67b1be5ed [file] [log] [blame]
Jeff Thompsonef2d5a42013-08-22 19:09:24 -07001// 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 Thompson3d613fd2013-10-15 15:39:04 -070011#ifndef NDNBOOST_RANGE_DETAIL_ITERATOR_HPP
12#define NDNBOOST_RANGE_DETAIL_ITERATOR_HPP
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070013
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
23namespace 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 Thompson3d613fd2013-10-15 15:39:04 -070042 typedef NDNBOOST_RANGE_DEDUCED_TYPENAME C::iterator type;
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070043 };
44 };
45
46 template<>
47 struct range_iterator_<std_pair_>
48 {
49 template< typename P >
50 struct pts
51 {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070052 typedef NDNBOOST_RANGE_DEDUCED_TYPENAME P::first_type type;
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070053 };
54 };
55
56 template<>
57 struct range_iterator_<array_>
58 {
59 template< typename T >
60 struct pts
61 {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070062 typedef NDNBOOST_RANGE_DEDUCED_TYPENAME
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070063 remove_extent<T>::type* type;
64 };
65 };
66
67 }
68
69 template< typename C >
70 class range_mutable_iterator
71 {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070072 typedef NDNBOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070073 public:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070074 typedef typename range_detail::range_iterator_<c_type>::NDNBOOST_NESTED_TEMPLATE pts<C>::type type;
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070075 };
76}
77
78#endif