yat
0.14.5pre
|
#include <yat/utility/iterator_traits.h>
Public Types | |
typedef traits::data_reference | data_reference |
typedef traits::weight_reference | weight_reference |
Public Member Functions | |
data_reference | data (Iter iter) const |
weight_reference | weight (Iter iter) const |
The purpose of this class is to allow polymorphism between weighted and unweighted iterators. It allows to access data and weight for both weighted and unweighted iterators.
For weighted iterators this class requires that *Iter has functions data(void) and weight(void).
typedef traits::data_reference theplu::yat::utility::iterator_traits< Iter >::data_reference |
For unweighted iterator, data_reference is the same as std::iterator_traits<Iter>::reference, i.e., the data if the iterator is the same as *Iter.
For weighted iterators, data_reference is double& if *Iter has a function double& data(void). Otherwise data_reference is const double.
typedef traits::weight_reference theplu::yat::utility::iterator_traits< Iter >::weight_reference |
For unweighted iterator, weight_reference is const double since the weight is always implicitly 1.0 and not mutable.
For weighted iterators, weight_reference is double& if *Iter has a function double& weight(void). Otherwise weight_reference is const double.
|
inline |
|
inline |