[Insight-developers] ImageRegionConstIterator operator*

Miller, James V (Research) millerjv at crd . ge . com
Wed, 25 Jun 2003 11:35:07 -0400


We used to have operator* defined on the iterators.  But to support
ImageAdaptors we had to remove operator*. Since operator* can typically
be used as a lvalue or rvalue, operator* is incompatible with the 
ImageAdaptors. 

This in turn means that our Get() method is slower than operator* would
be since it has use return by value instead of return by reference.



> -----Original Message-----
> From: Yarden Livnat [mailto:yarden at cs . utah . edu]
> Sent: Wednesday, June 25, 2003 11:30 AM
> To: insight-developers at itk . org
> Subject: Re: [Insight-developers] ImageRegionConstIterator operator*
> 
> 
> Luis,
> 
> Iterators should follow a certain conventions such as providing
> ++, and * (dereferencing) operators. It's true that as long as one
> work only within the realm of ITK get() is fine, it is not a standard
> way. Once you start working with external code you start to appreciate
> consistency. For example, we can not use ITK iterator for SCIRun code
> which assume it can dereference an iterator (as in STL) in 
> order to get
> to the object. Of cause one can (and we did) derive a new 
> iterator from
> the ITK iterator and added the operator*() which in turn calls .get() 
> but
> it will be cleaner in general if the dereferencing will be 
> part of ITK 
> iterators.
> 
> does it make sense ?
> 
> 	Yarden
> 
> On Wednesday, June 25, 2003, at 09:15  AM, Luis Ibanez wrote:
> 
> >
> > Hi Darby,
> >
> > Is there any reason for not using the
> > current "Get()" method in your code ?
> >
> >
> >   Luis
> >
> >
> > ------------------------
> > Darby J Van Uitert wrote:
> >> Can I add the operator* to the ImageRegionConstIterator class?
> >> 	-darby j
> >> ---------------------------
> >> Darby J Van Uitert
> >> SCI Institute
> >> University of Utah
> >> Email: darbyb at cs . utah . edu
> >> Phone: 801.585.1869
> >> ---------------------------
> >> _______________________________________________
> >> Insight-developers mailing list
> >> Insight-developers at itk . org
> >> http://www . itk . org/mailman/listinfo/insight-developers
> >
> >
> >
> > _______________________________________________
> > Insight-developers mailing list
> > Insight-developers at itk . org
> > http://www . itk . org/mailman/listinfo/insight-developers
> >
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk . org
> http://www . itk . org/mailman/listinfo/insight-developers
>