Hello. I'm trying to create a class containing a static data member which is an array of function pointers, but I can't work out the syntax to define and initialise it in the corresponding source file. I don't have a problem with defining a global array of function pointers however.
Code:
header.hpp
class C
{
public:
void funcA();
void funcB();
void funcC();
private:
static void (C::*pfunc1[])();
};
extern void (C::*pfunc2[])();
source.cpp
void C::(C::*pfunc1[])() = { C::funcA, C::funcB, C::funcC }; // gives error 'Identifier expected at line x' on Borland compiler
void (C::*pfunc2[])() = { C::funcA, C::funcB, C::funcC }; // works OK
Is this too obscure an idea for my own good? Any help appreciated.