1 // Copyright David Abrahams 2003. Permission to copy, use,
2 // modify, sell and distribute this software is granted provided this
3 // copyright notice appears in all copies. This software is provided
4 // "as is" without express or implied warranty, and with no claim as
5 // to its suitability for any purpose.
6 #ifndef ITERATOR_TRAITS_DWA200347_HPP
7 # define ITERATOR_TRAITS_DWA200347_HPP
9 # include <boost/detail/iterator.hpp>
10 # include <boost/detail/workaround.hpp>
14 // Unfortunately, g++ 2.95.x chokes when we define a class template
15 // iterator_category which has the same name as its
16 // std::iterator_category() function, probably due in part to the
17 // "std:: is visible globally" hack it uses. Use
18 // BOOST_ITERATOR_CATEGORY to write code that's portable to older
21 # if BOOST_WORKAROUND(__GNUC__, <= 2)
22 # define BOOST_ITERATOR_CATEGORY iterator_category_
24 # define BOOST_ITERATOR_CATEGORY iterator_category
28 template <class Iterator>
31 typedef typename detail::iterator_traits<Iterator>::value_type type;
34 template <class Iterator>
35 struct iterator_reference
37 typedef typename detail::iterator_traits<Iterator>::reference type;
41 template <class Iterator>
42 struct iterator_pointer
44 typedef typename detail::iterator_traits<Iterator>::pointer type;
47 template <class Iterator>
48 struct iterator_difference
50 typedef typename detail::iterator_traits<Iterator>::difference_type type;
53 template <class Iterator>
54 struct BOOST_ITERATOR_CATEGORY
56 typedef typename detail::iterator_traits<Iterator>::iterator_category type;
59 # if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
61 struct iterator_value<int>
67 struct iterator_reference<int>
73 struct iterator_pointer<int>
79 struct iterator_difference<int>
85 struct BOOST_ITERATOR_CATEGORY<int>
91 } // namespace boost::iterator
93 #endif // ITERATOR_TRAITS_DWA200347_HPP