Boost logo

Boost :

Subject: Re: [boost] Boost.RangeEx: contains?
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-02-23 15:30:33


Giovanni Piero Deretta skrev:

> If I understand the documentation correctly, you can do
> boost::find<boost::return_found_end>(rng | filtered(pred)) to get
> exactly what you want. I find this very useful, but the syntax is a
> bit verbose.

Yeah, I guess getting the specification right is more important first.

As for syntax, I guess we could maybe do something like

   boost::find[_f,_e]( rng | filtered );

Then, other return ranges could be specified in this EDSL as

   boost::find[_f+_1,e_]( rng | filtered );
   boost::find[_f-_1,e_]( rng | filtered );
   boost::find[_b,_f+_1]( rng | filtered );
   boost::find[_b,_f]( rng | filtered );
   boost::find[_b,_f+_1]( rng | filtered );

and perhaps even allow

   boost::find[_b+_next(n),_f]( rng | filtered );

etc.

-Thorsten


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