Boost logo

Boost :

Subject: Re: [boost] Boost.RangeEx: contains?
From: Eric Niebler (eric_at_[hidden])
Date: 2009-02-23 16:19:57


Thorsten Ottosen wrote:
> 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.

Me too.

> 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 );

Interesting! That's really not half bad.

> and perhaps even allow
>
> boost::find[_b+_next(n),_f]( rng | filtered );

Whoa. That could make it too easy to create invalid ranges, but way to
think outside the box!

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

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