Boost logo

Boost :

Subject: Re: [boost] Formal Review: Boost.RangeEx
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-02-25 13:04:42


Giovanni Piero Deretta skrev:

> FWIW, I have code like this:
>
> total = ( r | filter(_r, f) | map(_r, m) | accumulate(_r, zero, a) );
>
> i.e. I don't have a strong distinction between adaptor and algorithms.

The question is we should have weak or no distinction, or perhaps
a little strong destinction. I must admit, the code looks nice.

What about something like

   total = r | filter(f) | map(m) -> accumulate(zero, a);

or

   total = r | filter(f) | map(m) >> accumulate(zero, a);

?

The is a problem when we just want to apply several algorithms:

  boost::erase( cont, boost::unique( boost::sort(cont) ) );

How do we express this? Perhaps

  boost::erase( cont, cont >> sort >> unique );

?

-Thorsten


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