阅读背景:

无法将重载函数指针转换为成员函数指针?

来源:互联网 

I have code as following

我的代码如下

class A
{
public:
    int Key() const;
};

class B : public A
{};

template<class T, int (T::*MemFunction)() const>
class TT
{
public:
    int Get() const               {return (m_t.*MemFunction)();}

private:
    T m_t;
};

TT<B, &B::Key> t; // Wrong, cannot convert overloaded function
                  // to int (T::*MemFunction)() (VS2010)
class A
{
p



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: