You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to support early abortion in meta::for_each (or the like).
So basically to do something at runtime for a specific Trait we can do:
int index = 2;
using A = meta::list<TraitA, TraitB , TraitC>;
meta::for_each(A{}, [](auto a){
using Trait = decltype(a);
if (meta::find_index<A, Trait> == index)
{
// do something ...returnfalse; // abort iteration, not possible right now
}
returntrue; // true for continuation, not possible right now
});
So far since its a aggregate initialization under the hood, this will not be possible.
Is there a better way of doing the above? With something else?
The text was updated successfully, but these errors were encountered:
gabyx
changed the title
Early abortion in for_each ...
Early abortion in for_each possible?
Feb 1, 2019
Is there any way to support early abortion in
meta::for_each
(or the like).So basically to do something at runtime for a specific
Trait
we can do:So far since its a aggregate initialization under the hood, this will not be possible.
Is there a better way of doing the above? With something else?
The text was updated successfully, but these errors were encountered: