|
Boost Users : |
Subject: Re: [Boost-users] [iterators][range][rangeex] range concatenation
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-04-08 02:45:21
Steven Watanabe skrev:
> AMDG
>
> Thorsten Ottosen wrote:
>> Steven Watanabe skrev:
>>> AMDG
>>>
>>> Thorsten Ottosen wrote:
>>>> I suspect that r1 | join(r2) | join(r3) will be less efficient than
>>>> join(r1,r2,r3), because the former will lead to double checks
>>>> of which range that is being iterated, unless there is some clever way
>>>> to avoid that. But the | joined(r1,r2) syntax or whatever is fine
>>>> with me.
>>>
>>> It would be pretty easy to make r1 | join(r2) recognize whether
>>> r1 and r1 are themselves joint_views.
>>
>> Right, but is it easy to "unroll" the necessary information
>> inside e.g. increment()?
>
> You don't necessarily have to.
>
> template<class Sequences>
> class joint_view;
>
> template<class S, class R>
> joint_view<typename mpl::push_back<S, R>::type>
> operator|(const joint_view<S>& v, R& r);
The hard part is the implementation of increment()/decrement().
-Thorsten
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net