yat
0.20.3pre
|
#include <yat/utility/WeightIterator.h>
Public Member Functions | |
WeightIterator (void) | |
Default Constructor. More... | |
WeightIterator (Base b) | |
Constructor from Base iterator. | |
template<typename B2 > | |
WeightIterator (WeightIterator< B2 > other, typename boost::enable_if_convertible< B2, Base >::type *=0) | |
Conversion constructor. More... | |
iterator_traits< Base >::weight_reference | operator* (void) const |
Related Functions | |
(Note that these are not member functions.) | |
template<typename Base > | |
WeightIterator< Base > | weight_iterator (Base base) |
convenient function to create WeightIterator More... | |
WeightIterator is an iterator adaptor that enables iterating over a weighted range but accessing only the weight part of the range. The iterator behaves just like it Base iterator except that operator* returns iterator_traits<Base>.weight(base), i.e., the weight part is returned.
Here is a short example illustrating typical usage:
Type Requirement:
BASE
must model a Data Iterator
|
inline |
Default Constructor.
|
inline |
Conversion constructor.
Create a WeightIterator<Base> from a WeightIterator<B2>. Possible if B2 is convertible to a Base. Constructor allows implicit conversions such as iterator to const_iterator.
|
inline |
using iterator_traits::weight on Base iterator
|
related |
convenient function to create WeightIterator
Convenient function in same fashion as std::make_pair.