#include <iostream>

using namespace std;

class Base
{
public:
	virtual void P()
	{
		cout<<"Base::P"<<endl;
	}
};

class Dev : public Base
{
public:
	virtual void P()
	{
		cout<<"Dev::P"<<endl;
	}
};

typedef void (Base::*Func)();

int main ()
{
	Func pfunc = &Base::P;

	Dev d;

	(d.*pfunc)();

	return 0;
}

  调用的是Dev::p

相关文章:

  • 2021-12-09
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2021-09-10
猜你喜欢
  • 2022-01-29
  • 2021-06-03
  • 2022-12-23
  • 2021-11-15
  • 2021-05-22
  • 2021-08-26
  • 2021-07-15
相关资源
相似解决方案