K
Ken Human
I need to create a pointer to a class's constructor and I'm not sure how
it can be done, if at all. My code follows:
class A {
public:
A() { };
void B() { };
};
A (A::* pA)(void) = &A::A;
void (A::* pB)(void) = &A::B;
int main() {
return 0;
}
The line A (A::* pA)(void) = &A::A; gives me a compiler error: cannot
take address of this member function.
Is there any way around this?
it can be done, if at all. My code follows:
class A {
public:
A() { };
void B() { };
};
A (A::* pA)(void) = &A::A;
void (A::* pB)(void) = &A::B;
int main() {
return 0;
}
The line A (A::* pA)(void) = &A::A; gives me a compiler error: cannot
take address of this member function.
Is there any way around this?