私は次のクラスを持っています:
class Point2D
{
protected:
double x;
double y;
public:
double getX() const {return this->x;}
double getY() const {return this->y;}
...
};
別のクラスで宣言されたメンバー関数へのポインター:
double ( Point2D :: *getCoord) () const;
メンバ関数へのポインタを宣言/初期化する方法:
1]静的クラスメンバー関数
Process.h
class Process
{
private:
static double ( Point2D :: *getCoord) () const; //How to initialize in Process.cpp?
...
};
2]非クラスメンバー関数
Process.h
double ( Point2D :: *getCoord) () const; //Linker error, how do declare?
class Process
{
private:
...
};