mercredi 6 juin 2018

Iterate over tuple of functors in c++11

I have a tuple of functors (of unknown arity) that are expected to all return the same type, so something like:

typedef functor std::function<bool()>;
std::tuple<functor, functor, functor...> functors;

I'd like to iterate over functors, evaluating each member until I find one that succeeds, otherwise failure. How can I achieve this in c++11?

Aucun commentaire:

Enregistrer un commentaire