Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2006-09-29 01:09:24


Joel de Guzman wrote:
> David Abrahams wrote:
>>
>> * Boost.Fusion interprets a pair<int*,int*> as a sequence of two
>> values of type int*.
>>
>> * Boost.Range interprets a pair<int*,int*> x as a sequence of
>> x.second-x.first values of type int.
>
> Oh man, Now I see the problem. Pardon my slowness!!! Well, it
> seems, this interpretation of Boost.Range for pair<T*,T*> (or in
> general, std::pair<iterator,iterator> is at the very least
> suspicious. If we all agree that pair<T,T> is a tuple (a
> sequence in Fusion's sense), then pair<T*,T*> shouldn't be
> any different. I'd say that treating std::pair<iterator,iterator>
> as a runtime sequence is the wrong generalization.

It cannot be helped. std::equal_range returns a
std::pair<iterator,iterator>. You'll have to argue with Stepanov about it.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

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