23 May
2007
23 May
'07
3:28 p.m.
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