2 // Boost.Pointer Container
4 // Copyright Thorsten Ottosen 2003-2005. Use, modification and
5 // distribution is subject to the Boost Software License, Version
6 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // For more information, see http://www.boost.org/libs/ptr_container/
12 #ifndef BOOST_PTR_CONTAINER_MAP_ITERATOR_HPP
13 #define BOOST_PTR_CONTAINER_MAP_ITERATOR_HPP
15 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
19 #include <boost/config.hpp>
20 #include <boost/iterator/iterator_adaptor.hpp>
25 namespace ptr_container_detail
27 template< class F, class S >
31 typedef S second_type;
36 template< class F2, class S2 >
37 ref_pair( const std::pair<F2,S2>& p )
38 : first(p.first), second(static_cast<S>(p.second))
42 ref_pair( const RP* rp )
43 : first(rp->first), second(rp->second)
46 const ref_pair* const operator->() const
54 class I, // base iterator
55 class F, // first type, key type
56 class S // second type, mapped type
58 class ptr_map_iterator :
59 public boost::iterator_adaptor< ptr_map_iterator<I,F,S>, I,
60 ptr_container_detail::ref_pair<F,S>,
62 ptr_container_detail::ref_pair<F,S> >
64 typedef boost::iterator_adaptor< ptr_map_iterator<I,F,S>, I,
65 ptr_container_detail::ref_pair<F,S>,
67 ptr_container_detail::ref_pair<F,S> >
72 ptr_map_iterator() : base_type()
75 explicit ptr_map_iterator( const I& i ) : base_type(i)
78 template< class I2, class F2, class S2 >
79 ptr_map_iterator( const ptr_map_iterator<I2,F2,S2>& r )
83 }; // class 'ptr_map_iterator'