1 // interator.hpp workarounds for non-conforming standard libraries ---------//
\r
3 // (C) Copyright Beman Dawes 2000. Distributed under the Boost
\r
4 // Software License, Version 1.0. (See accompanying file
\r
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
\r
7 // See http://www.boost.org/libs/utility for documentation.
\r
10 // 12 Jan 01 added <cstddef> for std::ptrdiff_t (Jens Maurer)
\r
11 // 28 Jun 00 Workarounds to deal with known MSVC bugs (David Abrahams)
\r
12 // 26 Jun 00 Initial version (Jeremy Siek)
\r
14 #ifndef BOOST_ITERATOR_HPP
\r
15 #define BOOST_ITERATOR_HPP
\r
18 #include <cstddef> // std::ptrdiff_t
\r
19 #include <boost/config.hpp>
\r
23 # if defined(BOOST_NO_STD_ITERATOR) && !defined(BOOST_MSVC_STD_ITERATOR)
\r
24 template <class Category, class T,
\r
25 class Distance = std::ptrdiff_t,
\r
26 class Pointer = T*, class Reference = T&>
\r
29 typedef T value_type;
\r
30 typedef Distance difference_type;
\r
31 typedef Pointer pointer;
\r
32 typedef Reference reference;
\r
33 typedef Category iterator_category;
\r
37 // declare iterator_base in namespace detail to work around MSVC bugs which
\r
38 // prevent derivation from an identically-named class in a different namespace.
\r
40 template <class Category, class T, class Distance, class Pointer, class Reference>
\r
41 # if !defined(BOOST_MSVC_STD_ITERATOR)
\r
42 struct iterator_base : std::iterator<Category, T, Distance, Pointer, Reference> {};
\r
44 struct iterator_base : std::iterator<Category, T, Distance>
\r
46 typedef Reference reference;
\r
47 typedef Pointer pointer;
\r
48 typedef Distance difference_type;
\r
53 template <class Category, class T, class Distance = std::ptrdiff_t,
\r
54 class Pointer = T*, class Reference = T&>
\r
55 struct iterator : boost::detail::iterator_base<Category, T, Distance, Pointer, Reference> {};
\r
57 } // namespace boost
\r
59 #endif // BOOST_ITERATOR_HPP
\r