
25 Feb
2009
25 Feb
'09
6:04 p.m.
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