epoc32/include/stdapis/boost/iterator.hpp
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
//  interator.hpp workarounds for non-conforming standard libraries  ---------//
williamr@4
     2
williamr@4
     3
//  (C) Copyright Beman Dawes 2000. Distributed under the Boost
williamr@4
     4
//  Software License, Version 1.0. (See accompanying file
williamr@4
     5
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
williamr@4
     6
williamr@4
     7
//  See http://www.boost.org/libs/utility for documentation.
williamr@4
     8
williamr@4
     9
//  Revision History
williamr@4
    10
//  12 Jan 01 added <cstddef> for std::ptrdiff_t (Jens Maurer)
williamr@4
    11
//  28 Jun 00 Workarounds to deal with known MSVC bugs (David Abrahams)
williamr@4
    12
//  26 Jun 00 Initial version (Jeremy Siek)
williamr@4
    13
williamr@4
    14
#ifndef BOOST_ITERATOR_HPP
williamr@4
    15
#define BOOST_ITERATOR_HPP
williamr@4
    16
williamr@4
    17
#include <iterator>
williamr@4
    18
#include <cstddef>           // std::ptrdiff_t
williamr@4
    19
#include <boost/config.hpp>
williamr@4
    20
williamr@4
    21
namespace boost
williamr@4
    22
{
williamr@4
    23
# if defined(BOOST_NO_STD_ITERATOR) && !defined(BOOST_MSVC_STD_ITERATOR)
williamr@4
    24
  template <class Category, class T,
williamr@4
    25
    class Distance = std::ptrdiff_t,
williamr@4
    26
    class Pointer = T*, class Reference = T&>
williamr@4
    27
  struct iterator
williamr@4
    28
  {
williamr@4
    29
    typedef T         value_type;
williamr@4
    30
    typedef Distance  difference_type;
williamr@4
    31
    typedef Pointer   pointer;
williamr@4
    32
    typedef Reference reference;
williamr@4
    33
    typedef Category  iterator_category;
williamr@4
    34
  };
williamr@4
    35
# else
williamr@4
    36
williamr@4
    37
  // declare iterator_base in namespace detail to work around MSVC bugs which
williamr@4
    38
  // prevent derivation from an identically-named class in a different namespace.
williamr@4
    39
  namespace detail {
williamr@4
    40
   template <class Category, class T, class Distance, class Pointer, class Reference>
williamr@4
    41
#  if !defined(BOOST_MSVC_STD_ITERATOR)
williamr@4
    42
   struct iterator_base : std::iterator<Category, T, Distance, Pointer, Reference> {};
williamr@4
    43
#  else
williamr@4
    44
   struct iterator_base : std::iterator<Category, T, Distance>
williamr@4
    45
   {
williamr@4
    46
     typedef Reference reference;
williamr@4
    47
     typedef Pointer pointer;
williamr@4
    48
     typedef Distance difference_type;
williamr@4
    49
   };
williamr@4
    50
#  endif
williamr@4
    51
  }
williamr@4
    52
williamr@4
    53
  template <class Category, class T, class Distance = std::ptrdiff_t,
williamr@4
    54
            class Pointer = T*, class Reference = T&>
williamr@4
    55
  struct iterator : boost::detail::iterator_base<Category, T, Distance, Pointer, Reference> {};
williamr@4
    56
# endif
williamr@4
    57
} // namespace boost
williamr@4
    58
williamr@4
    59
#endif // BOOST_ITERATOR_HPP