Go to the documentation of this file.
11 #ifndef MEMBER_ITERATOR_HPP
12 #define MEMBER_ITERATOR_HPP
51 bool operator==(
const Derived& other)
const {
return it == other.it; }
53 bool operator!=(
const Derived& other)
const {
return it != other.it; }
61 return static_cast<Derived&
>(*this);
70 return static_cast<Derived&
>(*this);
91 return static_cast<Derived&
>(*this);
112 return static_cast<Derived&
>(*this);
121 return static_cast<Derived&
>(*this);
125 return it < other.it;
129 return it > other.it;
133 return it <= other.it;
137 return it >= other.it;
175 return last.it - first.it;
227 template <class Iterator, class T, T std::iterator_traits<Iterator>::value_type::*member,
class Reference = T&,
230 :
public BaseIterator<Iterator, SelectMemberIterator<Iterator, T, member, Reference, Pointer> > {
286 return (*this->
it).*member;
292 return (*this->
it).*member;
299 return &((*this->
it).*member);
305 return &((*this->
it).*member);
315 template <class Iterator, class T, T remove_pointer<typename std::iterator_traits<Iterator>::value_type>::type::*member,
316 class Reference = T&,
class Pointer = T*>
318 :
public BaseIterator<Iterator, SelectMemberPointerIterator<Iterator, T, member, Reference, Pointer> > {
374 return (**this->
it).*member;
380 return (**this->
it).*member;
387 return &((**this->
it).*member);
393 return &((**this->
it).*member);
SelectMemberIterator()
Default constructor.
friend Derived operator-(const Derived &it, difference_type n)
std::iterator_traits< Iterator >::difference_type difference_type
Type of the difference between two iterators.
BaseIterator(const base_iterator &i)
Conversion from the base iterator.
const pointer operator->() const
Pointer-like constant arrow operator.
friend difference_type operator-(const Derived &last, const Derived &first)
Distance between two iterators.
reference operator*()
Dereference operator.
reference operator*()
Dereference operator.
BaseIterator< Iterator, SelectMemberIterator< Iterator, T, member, Reference, Pointer > > Super
Type of the base class.
bool operator>=(const Derived &other) const
SelectMemberPointerIterator(const SelectMemberPointerIterator &other)
Copy constructor.
Derived & operator=(const Derived ©)
Assignment operator.
base_iterator it
Underlying iterator.
bool operator==(const Derived &other) const
pointer operator->()
Pointer-like arrow operator.
Derived & operator++(int)
Postfix increment operator.
Derived & operator--()
Prefix decrement operator.
std::iterator_traits< Iterator >::iterator_category iterator_category
Category of the iterator.
SelectMemberIterator(const SelectMemberIterator &other)
Copy constructor.
base_iterator base() const
Direct access to the base iterator.
Pointer pointer
Type of a pointer on the values.
bool operator!=(const Derived &other) const
const reference operator*() const
Constant dereference operator.
pointer operator->()
Pointer-like arrow operator.
Distributed matrix library.
Iterate over a container of structure, dereferencing only a member of it.
std::iterator_traits< Iterator >::iterator_category iterator_category
Category of the iterator.
bool operator<(const Derived &other) const
Derived & operator--(int)
Postfix decrement operator.
bool operator<=(const Derived &other) const
Reference reference
Type of a reference on the values.
Reference reference
Type of a reference on the values.
BaseIterator< Iterator, SelectMemberPointerIterator< Iterator, T, member, Reference, Pointer > > Super
Type of the base class.
std::iterator_traits< Iterator >::difference_type difference_type
Type of the difference between two iterators.
SelectMemberPointerIterator(const base_iterator &i)
Conversion from the base iterator.
const reference operator*() const
Constant dereference operator.
Derived & operator+=(difference_type n)
In-place random increment operator.
const pointer operator->() const
Pointer-like constant arrow operator.
Iterator base_iterator
Type of the underlying iterator.
BaseIterator()
Default constructor.
T value_type
Type of the value iterated on.
SelectMemberIterator(const base_iterator &i)
Conversion from the base iterator.
friend Derived operator+(const Derived &it, difference_type n)
SelectMemberPointerIterator()
Default constructor.
friend Derived operator-(difference_type n, const Derived &it)
Derived & operator++()
Prefix increment operator.
friend Derived operator+(difference_type n, const Derived &it)
std::iterator_traits< Iterator >::difference_type difference_type
Type of the difference between two iterators.
Derived & operator-=(difference_type n)
In-place random decrement operator.
bool operator>(const Derived &other) const
T value_type
Type of the value iterated on.
Iterator base_iterator
Type of the underlying iterator.
BaseIterator(const BaseIterator &other)
Copy constructor.
Pointer pointer
Type of a pointer on the values.