class CA
{
public:
CA(void (*pfn)(int));
};
class CB
{
public:
CB()
{
CA a(&Fx1);
};
public:
void Fx1(int)
{};
};
/////////////
error C2276: '&' : illegal operation on bound member function expression
solution:
class CA;
class CB
{
public:
CB(void (CA::*)()){};
};
class CA
{
public:
CA()
{
CB b(&CA::Fx);
};
void Fx();
};
没有评论:
发表评论