os/ossrv/ossrv_pub/boost_apis/boost/range/iterator.hpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Boost.Range library
sl@0
     2
//
sl@0
     3
//  Copyright Thorsten Ottosen 2003-2004. Use, modification and
sl@0
     4
//  distribution is subject to the Boost Software License, Version
sl@0
     5
//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
sl@0
     6
//  http://www.boost.org/LICENSE_1_0.txt)
sl@0
     7
//
sl@0
     8
// For more information, see http://www.boost.org/libs/range/
sl@0
     9
//
sl@0
    10
sl@0
    11
#ifndef BOOST_RANGE_ITERATOR_HPP
sl@0
    12
#define BOOST_RANGE_ITERATOR_HPP
sl@0
    13
sl@0
    14
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
sl@0
    15
# pragma once
sl@0
    16
#endif
sl@0
    17
sl@0
    18
#include <boost/range/config.hpp>
sl@0
    19
sl@0
    20
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
sl@0
    21
#include <boost/range/detail/iterator.hpp>
sl@0
    22
#else
sl@0
    23
sl@0
    24
#include <boost/iterator/iterator_traits.hpp>
sl@0
    25
#include <cstddef>
sl@0
    26
#include <utility>
sl@0
    27
sl@0
    28
namespace boost
sl@0
    29
{
sl@0
    30
    //////////////////////////////////////////////////////////////////////////
sl@0
    31
    // default
sl@0
    32
    //////////////////////////////////////////////////////////////////////////
sl@0
    33
    
sl@0
    34
    template< typename C >
sl@0
    35
    struct range_iterator
sl@0
    36
    {
sl@0
    37
        typedef BOOST_DEDUCED_TYPENAME C::iterator type;
sl@0
    38
    };
sl@0
    39
    
sl@0
    40
    //////////////////////////////////////////////////////////////////////////
sl@0
    41
    // pair
sl@0
    42
    //////////////////////////////////////////////////////////////////////////
sl@0
    43
sl@0
    44
    template< typename Iterator >
sl@0
    45
    struct range_iterator< std::pair<Iterator,Iterator> >
sl@0
    46
    {
sl@0
    47
        typedef Iterator type;
sl@0
    48
    };
sl@0
    49
    
sl@0
    50
    template< typename Iterator >
sl@0
    51
    struct range_iterator< const std::pair<Iterator,Iterator> >
sl@0
    52
    {
sl@0
    53
        typedef Iterator type;
sl@0
    54
    };
sl@0
    55
sl@0
    56
    //////////////////////////////////////////////////////////////////////////
sl@0
    57
    // array
sl@0
    58
    //////////////////////////////////////////////////////////////////////////
sl@0
    59
sl@0
    60
    template< typename T, std::size_t sz >
sl@0
    61
    struct range_iterator< T[sz] >
sl@0
    62
    {
sl@0
    63
        typedef T* type;
sl@0
    64
    };
sl@0
    65
sl@0
    66
    template< typename T, std::size_t sz >
sl@0
    67
    struct range_iterator< const T[sz] >
sl@0
    68
    {
sl@0
    69
        typedef const T* type;
sl@0
    70
    };
sl@0
    71
sl@0
    72
    //////////////////////////////////////////////////////////////////////////
sl@0
    73
    // string
sl@0
    74
    //////////////////////////////////////////////////////////////////////////
sl@0
    75
sl@0
    76
    template<>
sl@0
    77
    struct range_iterator< char* >
sl@0
    78
    {
sl@0
    79
        typedef char* type;
sl@0
    80
    };
sl@0
    81
sl@0
    82
    template<>
sl@0
    83
    struct range_iterator< wchar_t* >
sl@0
    84
    {
sl@0
    85
        typedef wchar_t* type;
sl@0
    86
    };
sl@0
    87
sl@0
    88
    template<>
sl@0
    89
    struct range_iterator< const char* >
sl@0
    90
    {
sl@0
    91
        typedef const char* type;
sl@0
    92
    };
sl@0
    93
sl@0
    94
    template<>
sl@0
    95
    struct range_iterator< const wchar_t* >
sl@0
    96
    {
sl@0
    97
        typedef const wchar_t* type;
sl@0
    98
    };
sl@0
    99
sl@0
   100
    template<>
sl@0
   101
    struct range_iterator< char* const >
sl@0
   102
    {
sl@0
   103
        typedef char* type;
sl@0
   104
    };
sl@0
   105
sl@0
   106
    template<>
sl@0
   107
    struct range_iterator< wchar_t* const >
sl@0
   108
    {
sl@0
   109
        typedef wchar_t* type;
sl@0
   110
    };
sl@0
   111
sl@0
   112
    template<>
sl@0
   113
    struct range_iterator< const char* const >
sl@0
   114
    {
sl@0
   115
        typedef const char* type;
sl@0
   116
    };
sl@0
   117
sl@0
   118
    template<>
sl@0
   119
    struct range_iterator< const wchar_t* const >
sl@0
   120
    {
sl@0
   121
        typedef const wchar_t* type;
sl@0
   122
    };
sl@0
   123
sl@0
   124
} // namespace boost
sl@0
   125
sl@0
   126
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
sl@0
   127
sl@0
   128
#endif