1 // Copyright David Abrahams 2003.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef ITERATOR_TRAITS_DWA200347_HPP
6 # define ITERATOR_TRAITS_DWA200347_HPP
8 # include <boost/detail/iterator.hpp>
9 # include <boost/detail/workaround.hpp>
13 // Unfortunately, g++ 2.95.x chokes when we define a class template
14 // iterator_category which has the same name as its
15 // std::iterator_category() function, probably due in part to the
16 // "std:: is visible globally" hack it uses. Use
17 // BOOST_ITERATOR_CATEGORY to write code that's portable to older
20 # if BOOST_WORKAROUND(__GNUC__, <= 2)
21 # define BOOST_ITERATOR_CATEGORY iterator_category_
23 # define BOOST_ITERATOR_CATEGORY iterator_category
27 template <class Iterator>
30 typedef typename boost::detail::iterator_traits<Iterator>::value_type type;
33 template <class Iterator>
34 struct iterator_reference
36 typedef typename boost::detail::iterator_traits<Iterator>::reference type;
40 template <class Iterator>
41 struct iterator_pointer
43 typedef typename boost::detail::iterator_traits<Iterator>::pointer type;
46 template <class Iterator>
47 struct iterator_difference
49 typedef typename boost::detail::iterator_traits<Iterator>::difference_type type;
52 template <class Iterator>
53 struct BOOST_ITERATOR_CATEGORY
55 typedef typename boost::detail::iterator_traits<Iterator>::iterator_category type;
58 # if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
60 struct iterator_value<int>
66 struct iterator_reference<int>
72 struct iterator_pointer<int>
78 struct iterator_difference<int>
84 struct BOOST_ITERATOR_CATEGORY<int>
90 } // namespace boost::iterator
92 #endif // ITERATOR_TRAITS_DWA200347_HPP