Subject: Re: [boost] [odeint] Iterator semantics
From: Karsten Ahnert (karsten.ahnert_at_[hidden])
Date: 2012-08-19 04:30:07
On 08/19/2012 02:57 AM, Dave Abrahams wrote:
> on Fri Aug 10 2012, Karsten Ahnert <karsten.ahnert-AT-ambrosys.de> wrote:
>> I tried to find different solutions but it is difficult since one is
>> more or less always checking for overlap. On the other hand I wonder if
>> the requirement of transitivity can be relaxed in this case. I can not
>> imagine an algorithm where the above situation might occur. The iterator
>> is a single pass iterator which limits the number of possible
>> algorithms. Furthermore the violation can only appear if two end
>> iterators are used. This is not the case for all algorithms in the
>> standard and Boost.Range.
>> Any ideas or comments? Is it really necessary to require transitivity?
> Yes. Transitivity of == is fundamental.
Ok. Then, the question is which kind of algorithms will fail. I think
all algorithms where you pass exactly one end-iterator are ok, like
algorithm( first , last , ... )
You simply can not create an iterator for which transitivity which will
in such situations. This is the case for most algorithm in the STL and
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk