Boost logo

Boost :

Subject: Re: [boost] [range] fat iterators?
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2013-11-08 04:21:53


On 07-11-2013 22:33, Eric Niebler wrote:
> On 11/7/2013 8:29 PM, Thorsten Ottosen wrote:
>> Remark on your article: did you benchmark your new design in terms of
>> speed and size?
>

> I didn't measure performance, I admit. Non-locality is a valid concern.
> I have no doubt that it's possible to construct cases where one
> implementation is faster than the other. Lies, damn lies, and
> benchmarks, you know.

Sometimes. Genereated assembler would be another way to measure.

Let's assume a range that generates the iterators in your fashion.
Then in

template< class Rng >
void foo_algo( Rng& rng )
{ std::foo_algo( begin(rng), end(end) ); }

how much can we expect the optimizer? Both iterators will store a
reference to the range, and then might have some additional information.
Can the compiler see that the stored reference to the range is the same
and avoid one of them? If not, may we should think about how to inprove
the language to make this happen?

-Thorsten


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