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 7 8 # include <boost/detail/workaround.hpp> 9 10 #include <iterator> 11 12 namespace boost { 13 namespace iterators { 14 15 // Macro for supporting old compilers, no longer needed but kept 16 // for backwards compatibility (it was documented). 17 #define BOOST_ITERATOR_CATEGORY iterator_category 18 19 20 template <class Iterator> 21 struct iterator_value 22 { 23 typedef typename std::iterator_traits<Iterator>::value_type type; 24 }; 25 26 template <class Iterator> 27 struct iterator_reference 28 { 29 typedef typename std::iterator_traits<Iterator>::reference type; 30 }; 31 32 33 template <class Iterator> 34 struct iterator_pointer 35 { 36 typedef typename std::iterator_traits<Iterator>::pointer type; 37 }; 38 39 template <class Iterator> 40 struct iterator_difference 41 { 42 typedef typename std::iterator_traits<Iterator>::difference_type type; 43 }; 44 45 template <class Iterator> 46 struct iterator_category 47 { 48 typedef typename std::iterator_traits<Iterator>::iterator_category type; 49 }; 50 51 } // namespace iterators 52 53 using iterators::iterator_value; 54 using iterators::iterator_reference; 55 using iterators::iterator_pointer; 56 using iterators::iterator_difference; 57 using iterators::iterator_category; 58 59 } // namespace boost 60 61 #endif // ITERATOR_TRAITS_DWA200347_HPP 62