Opened 13 years ago

Closed 13 years ago

#633 closed enhancement (fixed)

test and docs for DataIterator requirements

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


Looking into ticket #631 I realized it is not clear what the requirements are on DataIterator. We should test those, add CONCEPT_ASSERT, and document.

And same thing for twin class WeightIterator.

Change History (5)

comment:1 Changed 13 years ago by Peter

(In [2277]) some test code for data_iterator (refs #633).

comment:2 Changed 13 years ago by Peter

Status: newassigned

There seems to be a problem in iterator_traits for weighted iterators. The problem occurs for pure output iterators and input iterators with a proxy value class.

In the first case, output iterators, I suspect the problem is there is no access operator. Need more investigations to find if it's possible to solve.

In the second case, the problem is that we call (*iter).data() and if the proxy class doesn't have a function data, this will not compile. This is not a big problem because typically the value_type of a weighted iterator is DataWeight and yat provides a proxy class DataWeightProxy, which has a function data() (and weight()). Therefore there should be no problem as long as the proxy class is a DataWeightProxy. I think documenting the limitation should be sufficient here, and, if possible, improve the compiler error message.

comment:3 Changed 13 years ago by Peter

(In [2280]) adding comment on limitations of iterator_traits, refs #633

comment:4 Changed 13 years ago by Peter

(In [2281]) fixing some style, refs #633

comment:5 Changed 13 years ago by Peter

Resolution: fixed
Status: assignedclosed

(In [2282]) document and test that DataIterator? and WeightIterator? works with/requires input_iterator. closes #633

Note: See TracTickets for help on using tickets.