Neil Groves | 29 Aug 15:25

Re: lifetime of ranges vs. iterators

On Fri, Aug 29, 2008 at 2:13 PM, Arno Schödl <aschoedl <at> think-cell.com>wrote:

> I have seen your | operator. It is o.k. for unary things, like rng |
> filter( predicate ), but for binary things, it is a bit weird:
>
> rngA | difference(rngB)
>
> I find the alternatives clearer: rngA - rngB would be nice (but requires
> concept checking), or difference( rngA, rngB ).
>

Indeed I can definately see your point about binary operations.

>
> But regardless of notation, doesn't this suffer from the same problem that
> these objects are temporaries?
>

Yes, it does not help at all with the 'difference' issue. Would you be able
to supply code for the difference solution you have proposed? I would be
happy to look at it. It would help me understand the problem more
concretely. If you have specific suggestions for changes to range / range_ex
then I would be happy to consider them. With my currently level of
non-understanding of the actual difference algorithm I wonder if the result
is not more appropriately a model of a Container rather than a Range?

Neil

>
> Arno
>
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Gmane