Boost logo

Boost :

Subject: Re: [boost] [range] Performance benchmarks?
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-02-01 21:00:42


on Wed Feb 01 2012, Mathias Gaunard <mathias.gaunard-AT-ens-lyon.org> wrote:

> On 02/01/2012 10:19 PM, Dave Abrahams wrote:
>>
>> on Wed Feb 01 2012, Mathias Gaunard<mathias.gaunard-AT-ens-lyon.org> wrote:
>>
>>> On 02/01/2012 04:39 PM, Beman Dawes wrote:
>>>> A question came up in a long bikeshed discussion on a C++ committee
>>>> mailing list as to the performance of range based interface versus a
>>>> begin/end iterator interface (I.E. traditional STL interface) to the
>>>> same algorithms.
>>>
>>> It's exactly the same performance, because a range is just a pair of
>>> begin/end iterators and all the code is implemented using the
>>> iterators.
>>
>> No, a range is not _necessarily_ a pair of begin/end iterators.
>
> They are in Boost, and in particular in Boost.Range, which was being
> asked about here.

I understand. Maybe Beman didn't know that Boost.Range ranges were
iterator pairs. In the end,

  We're explicitly interested in what happens to efficiency when
  algorithms are /implemented/ using range primitives rather than by
  iterator increment, comparison, etc.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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