std::apply with branch depending on tuple element value

70 Views Asked by At

I have a std::tuple that contains holds different pointers:

std::tuple<int*, double*> foo;

Now I want to visit all elements in foo and perform an action on every element that is not nullptr. For this I could roll a template loop, but it would be much nicer with a solution based on std::apply or fold a fold expression.

0

There are 0 best solutions below