Well I still don't see a reason to avoid a normal array. The preprocessor can help you compile sections of code. I'll show a contrived example in a moment. Before that though, I assumed you would write a maximum number of functions.
So it depends on what you will link. As far as what gets compiled:
Code:
#define MAX_FUNCS 6
#define MIN_ARRAY 3
FuncPtrs doThis[MAX_FUNCS] = {
#if COMPILE_FUNCS == MIN_ARRAY
&foo,
&bar,
&baz,
#elsif COMPILE_FUNCS == 4
&foo,
&bar,
&baz,
&quz,
#else /* case COMPILE_ALL */
&foo,
&bar,
&baz,
&quz,
&qux,
#endif
};
This way, you can define a macro COMPILE_FUNCS with some implementation dependent, special number that will keep what you are using and ignore the other compiling options. COMPILE_FUNCS is the length of the array. As long as there is a MIN_ARRAY you will always use this technique can work.
You get the best of everything: array initializers, automatic storage, and case specific compiling.
You'll want to do this after committing more research time to the C++ preprocessor. Things can be a lot more robust then what I've shown you, such as making the compiler throw an error if there is a logical problem or a needed define is missing. But this is what I recommend.