Boost logo

Boost :

Subject: Re: [boost] [fusion] segmented fusion 2.0
From: Eric Niebler (eric_at_[hidden])
Date: 2011-08-11 20:22:35


On 8/11/2011 4:38 PM, Nathan Ridge wrote:
>>> Partially off-topic: Has there been any work done in boost on
>>> segmented iterators for regular algorithms (i.e. STL, not Fusion)?
>>
>> It wouldn't work without segmented flavors of the std algorithms. Have a
>> look at Matt Austern's paper. The algorithms and iterators work together.
>
> Right, that's what I meant - a collection of segmented iterators
> and corresponding algorithms. A "segmented STL", if you will :)

You'd also need to reimplement the containers, since they would have to
return segmented iterators.

I don't think anybody has proposed to implement such a thing. It's a
huge amount of work, and it wouldn't be as big a win. The runtime perf
gains would be modest, and it doesn't eliminate complexity because there
would be no equivalent universal "segmented iterator" in the runtime
world. (It would need to store the path-to-the-current-position
dynamically, which is a cost nobody would be willing to pay.) So
std::map would still need to implement its own iterators, and at that
point you have to ask yourself why you're doing all that extra work.

I suppose this is why we don't see an STL implementation that uses
segmented algorithms.

-- 
Eric Niebler
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