Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#445 closed request (fixed)

All iterators with value type `DataWeight` should be weighted

Reported by: Peter Owned by: Peter
Priority: major Milestone: yat 0.5
Component: utility Version: trunk
Keywords: Cc:

Description

Is it possible to implement such a rule?

There is a class weighted_iterator_traits that is taking care of this kind of thing, but that is templatized on Iterator. For example, there is specialization for std::vector<DataWeight>::iterator

template<>
struct weighted_iterator_traits<std::vector<DataWeight>::iterator> {
typedef weighted_iterator_tag type;
}

It would be useful if could generalize that specialization for all iterators that have value_type DataWeight. Not sure how to do such a thing, though.

related to ticket:395

Change History (3)

comment:1 Changed 15 years ago by Peter

Milestone: yat 0.x+yat 0.5
Status: newassigned

comment:2 Changed 15 years ago by Peter

Resolution: fixed
Status: assignedclosed

(In [1541]) fixes #445 so iterator_traits detects when value_type is DataWeight? and return weighted_iterator_tag. Also weighted_iterator_traits recognize some normal cases; when reference_type is DataWeight?& or const DataWeight?& weighted behaviour is performed.

Fixed some incorrect inclusion in WeightedIterator? and removed debug code in StrideIterator?.

comment:3 Changed 15 years ago by Peter

(In [1562]) specialization is not needed anymore due to change of default implementation (refs #445). Also refs #398

Note: See TracTickets for help on using tickets.