Boost logo

Boost Users :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2007-05-23 11:28:22


Daniel Wallin ha escrito:

> Joaquín Mª López Muñoz wrote:
> >
> > Scott Meyers ha escrito:
> [...]
> >> What I really want is something more like
> >> do_until<Sequence>(unaryFunctionObject) that will loop over all the entries in
> >> Sequence until the unaryFunctionObject returns true. Is there something like
> >> this in the MPL, must I roll my own, or am I approaching this the wrong way
> >> entirely?
> >
> > AFAIK you must roll your own. Please find attached a possible implementation
> > using mpl::fold.
>
> This is unnecessarily inefficient. It's pretty easy to just use
> iterators, something like:

[...]

So nice! Yep, this is much clearer, I guess I've got a case of fold-obsession :)

Best,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net