Boost logo

Boost :

Subject: Re: [boost] [iterator] reverse_iterator<counting_iterator<T>>
From: Arno Schödl (aschoedl_at_[hidden])
Date: 2010-04-13 16:30:20


> The change suggested by Arno (counting_iterator should return by value
> upon dereferencing unless the T member object is held by reference)
> seems like a good one.

constant_iterator<T>::reference could be defined as T, but operator* could return T const&. I am not sure if this fulfills the Iterator requirements in the standard, but it would avoid a copy when trivially calling it->func(), while still making reverse_iterator work as expected.

Arno

--
Dr. Arno Schoedl · aschoedl_at_[hidden] 
Technical Director 
 
think-cell Software GmbH · Chausseestr. 8/E · 10115 Berlin, Germany 
http://www.think-cell.com · phone +49 30 666473-10 · toll-free (US) +1 800 891 8091
Directors: Dr. Markus Hannebauer, Dr. Arno Schoedl · Amtsgericht Berlin-Charlottenburg, HRB 85229

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk