yap / YAP

Yet Another Partial Wave Analysis Toolkit
GNU General Public License v3.0
2 stars 4 forks source link

DataIterator -> RandomAccessIterator #37

Closed greenwald closed 8 years ago

greenwald commented 8 years ago

DataIterator should fulfill all requirements of http://en.cppreference.com/w/cpp/concept/RandomAccessIterator

pdigiglio commented 8 years ago

Is the VectorIterator constructor supposed to be public?

greenwald commented 8 years ago

Is there a reason for it not to be?

pdigiglio commented 8 years ago

I don't know. I asked because the DataIterator one is protected.

greenwald commented 8 years ago

For the moment leave them as is, I think.

pdigiglio commented 8 years ago

Is this the correct implementation of the pointer operator in DataIterator?

DataPoint operator->()
{ return *(this->Iterator_).operator->(); }

Should it return a (const) reference instead of the object itself?

greenwald commented 8 years ago

Since it is accessing the pointer to the object inside the iterator since it's a wrapper around another iterator, yes.

As to the const'ness: there should be both a const and nonconst version, I suppose. Check the standard.

On Mon, Jun 13, 2016 at 4:05 PM pdigiglio notifications@github.com wrote:

Is this the correct implementation of the pointer operator in DataIterator ?

DataPoint operator->() { return *(this->Iterator_).operator->(); }

Should it return a (const) reference instead of the object itself?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yap/YAP/issues/37#issuecomment-225590761, or mute the thread https://github.com/notifications/unsubscribe/ACc8EfXdMpDg4cq3GlOxVGr68VZL1UbRks5qLWOtgaJpZM4Iv2q0 .


Daniel Greenwald Physik-Department E18 Technische Universität München James-Franck-Str. 1 85748 Garching Germany

daniel.greenwald@tum.de tel : +49 89 / 289 12569 fax : +49 89 / 289 12570

greenwald commented 8 years ago

Closed by #57