20 #ifndef BOOST_PYTHON_INDEXING_PROXY_ITERATOR_HPP 21 #define BOOST_PYTHON_INDEXING_PROXY_ITERATOR_HPP 24 #include <boost/config.hpp> 25 #include <boost/iterator.hpp> 26 #include <boost/detail/workaround.hpp> 28 namespace boost {
namespace python {
namespace indexing {
30 template <
class ContainerProxy,
typename ElementProxy,
typename Traits,
31 typename Size,
typename Iter>
33 :
public boost::iterator<
34 std::random_access_iterator_tag,
36 typename Traits::difference_type,
41 #if !defined (BOOST_NO_MEMBER_TEMPLATE_FRIENDS) 45 typedef boost::iterator<
46 std::random_access_iterator_tag,
48 typename Traits::difference_type,
54 typedef ContainerProxy container_proxy_type;
56 typedef Iter raw_iterator;
57 typedef Traits raw_iterator_traits;
58 typedef Size size_type;
59 typedef typename base_type::value_type value_type;
60 typedef typename base_type::difference_type difference_type;
62 typedef value_type *pointer;
63 typedef value_type reference;
71 : ptr (p), index (iter - p->raw_container().begin())
75 reference operator*()
const {
return ptr->at(index); }
76 pointer operator->()
const {
return &ptr->at(index); }
77 reference operator[](size_type s) {
return ptr->at (index + s); }
80 proxy_iterator &operator+= (size_type s) { index += s;
return *
this; }
96 proxy_iterator &operator-= (size_type s) { index -= s;
return *
this; }
107 return index - i.index;
111 return (ptr == other.ptr) && (index == other.index);
115 return !(*
this == other);
119 return index < other.index;
123 return index <= other.index;
127 return index > other.index;
131 return index >= other.index;
135 ptr->swap_elements (index, other.index);
142 #if defined (BOOST_NO_MEMBER_TEMPLATE_FRIENDS) 148 container_proxy_type *ptr;
153 #if !BOOST_WORKAROUND (BOOST_MSVC, == 1300) 156 template <
class C,
typename E,
typename T,
typename S,
typename I>
161 first.iter_swap (second);
166 #endif // BOOST_PYTHON_INDEXING_PROXY_ITERATOR_HPP Definition: python_CEGUI.h:11
Definition: proxy_iterator.hpp:155
Definition: proxy_iterator.hpp:32
Definition: container_proxy.hpp:103