I have a package of parameters full of standard constructive and then called objects (for example, ExampleFunctor ), and you want to call them all in order (from left to right). If the return type is something other than void, I can use a list of initializers for this:
struct ExampleFunctor{ void operator()(){someGlobal = 4;} }; template<typename... Ts> struct CallThem { void operator()(){ auto list = {Ts()()...}; } }
however, if the return type is invalid, this trick does not work.
I could wrap all Ts in a wrapper that returns an int, but that seems redundant, and this code will eventually run on the M3 crust with 32K of flash memory, so the extra overhead of the wrapper function is a pain if I compile in mode debugging (and debugging in release mode makes my brain hurt).
Is there a better way?
source share