blob: 61ed3e88842453a1b1dba6e783b80e5fb1028c57 [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_CONST_ITERATOR_HPP
12#define NDNBOOST_RANGE_CONST_ITERATOR_HPP
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070013
14#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15# pragma once
16#endif
17
18#include <ndnboost/range/config.hpp>
19
Jeff Thompson3d613fd2013-10-15 15:39:04 -070020#ifdef NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070021#include <ndnboost/range/detail/const_iterator.hpp>
22#else
23
24#include <ndnboost/range/detail/extract_optional_type.hpp>
25#include <ndnboost/type_traits/remove_const.hpp>
26#include <cstddef>
27#include <utility>
28
29namespace ndnboost
30{
31 //////////////////////////////////////////////////////////////////////////
32 // default
33 //////////////////////////////////////////////////////////////////////////
34
35 namespace range_detail {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070036 NDNBOOST_RANGE_EXTRACT_OPTIONAL_TYPE( const_iterator )
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070037 }
38
39 template< typename C >
40 struct range_const_iterator : range_detail::extract_const_iterator<C>
41 {};
42
43 //////////////////////////////////////////////////////////////////////////
44 // pair
45 //////////////////////////////////////////////////////////////////////////
46
47 template< typename Iterator >
48 struct range_const_iterator< std::pair<Iterator,Iterator> >
49 {
50 typedef Iterator type;
51 };
52
53 //////////////////////////////////////////////////////////////////////////
54 // array
55 //////////////////////////////////////////////////////////////////////////
56
57 template< typename T, std::size_t sz >
58 struct range_const_iterator< T[sz] >
59 {
60 typedef const T* type;
61 };
62
63} // namespace ndnboost
64
Jeff Thompson3d613fd2013-10-15 15:39:04 -070065#endif // NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070066
67#endif