[Insight-developers] standardizing iterator api

Luis Ibanez ibanez@choroid.cs.unc.edu
Tue, 8 May 2001 18:08:34 -0400 (EDT)


On ImageIterators I would prefer option (1) for performance reasons.
Having to return an iterator and compare with it is costly in N-D.
ImageIterators contains internally enough information to rapidly
determine if they are at the end or beggining of the image, and to
eventually jump to those positions.

Don't know however if the (1) option is acceptable for itkContainers...

Eventually if they cannot share the same style, it could be
an advantage to make their API different enough to reflect this
different behaviors.


Luis

---


On Tue, 8 May 2001, Joshua Cates wrote:
> choice being to support either/or:
>
> 1.
> itkIterator it;
> for (it.Begin(); ! it.IsAtEnd(); ++it) {}
>
> 2.
> itkIterator it;
> for (it = it.Begin(); it < it.End(); ++it) {}
>
>
> Josh.