I need to include a different number of objects depending on the provided 'define' and with different ctor parameters
inline static std::array<A::Output, NUM_OUTPUTS> s_Outputs =
{
#if NUM_OUTPUTS > 0
A::Output{0}
#endif
#if NUM_OUTPUTS > 1
, A::Output{1}
#endif
#if NUM_OUTPUTS > 2
, A::Output{2}
#endif
};
Well depending on NUM_OUTPUTS respective number of the object should be created. Each object has an index, first is '0' and every next is '+1'.
Is there a way to do it more nicely? Probably macros to roll out in such declarations or anything else.