I have the following block:
int i = 0;
std::apply([&](auto &&... args) mutable {
((ef = (i++ == id) ?
args.modifyEffectVec(ef, arr) : ef), ...);
}, EffectsTuple);
When i++==id
, this is executed: args.modifyEffectVec(ef, arr)
. I want to log when this happens, so I know for which i
it happened. I tried
int i = 0;
std::apply([&](auto &&... args) mutable {
((ef = (i++ == id) ?
{
ALOGV(TAG, "modifying effect for id %d", id);
args.modifyEffectVec(ef, arr);
} : ef), ...);
}, EffectsTuple);
but I discovered Why ternary operator does not support blocks?
I'm not sure how can I substitute this ternary for an if because it happens inside this thing called a fold expression