Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2006-09-29 00:38:55


David Abrahams wrote:
> Joel de Guzman <joel_at_[hidden]> writes:
>
>>> [what's a mono-sequence?]
>> The opposite of hetero-sequence :P
>
> A mono-sequence is the opposite of a multi-sequence. The opposite of
> a hetero-sequence is a homo-sequence.

Oh my, yeah. I thought all along that was what I typed!
Must still be sleepy, or cross-eyed, or both :P

>>> It's not the same thing at all. In the case of array<int>, the
>>> sequence has the same elements in either case; we're just talking
>>> about two ways of accessing the same sequence. In the case of
>>> std::pair there are two completely distinct interpretations, either of
>>> which could be valid. In my case I think there are only two possible
>>> choices:
>>>
>>> 1. say that std::pair needs to be wrapped or otherwise
>>> transformed before I know how to treat it.

[...]
>
> * Boost.Range and Boost.Fusion both interpret an int*[4] as a
> sequence of 4 values of type int*. Consistent
>
> * 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.

Cheers,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

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