I have the following problem.
class Base
{
public:
void (*pfunc) (int) = 0;
};
class Derived : public Base
{
public:
void (*pfunc) (int a)
{
// Stuff
}
};
class Foo
{
private:
void (*pf) (int);
public:
Foo (Base* ptr)
{
pf = ptr->pfunc; // Error, because pfunc is a member function,
not static
}
};
Is there any way to do something like "pf = ptr->pfunc"?
Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
class Base
{
public:
void (*pfunc) (int) = 0;
};
class Derived : public Base
{
public:
void (*pfunc) (int a)
{
// Stuff
}
};
class Foo
{
private:
void (*pf) (int);
public:
Foo (Base* ptr)
{
pf = ptr->pfunc; // Error, because pfunc is a member function,
not static
}
};
Is there any way to do something like "pf = ptr->pfunc"?
Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
Comment