
25 Jul
2009
25 Jul
'09
12:43 a.m.
2009/7/24 Stewart, Robert <Robert.Stewart@sig.com>:
How about another try: traversing a range with changing criteria? A particular range class can take a predicate or some other traversal influencing argument that can change with each advance. How would you express that with iterator pairs?
At worst, it seems like you could always define a range_iterator<R> that holds a shared_ptr<R> and just forward to the range operations, with a null shared_ptr representing the "end" iterator. I agree it's inefficient, but I don't think that ranges can represent anything that iterators cannot (given sufficient contortion).