编译器错误 C3240

“function”:必须是“type”的非重载抽象成员函数

基类型包含已定义的函数。 函数必须是虚拟函数。

示例

下面的示例生成 C3240。

// C3240.cpp
// compile with: /c
__interface I {
   void f();
};

struct A1 : I {
   void f() {}
};

struct A2 : I {
   void f() = 0;
};

template <class T>
struct A3 : T {
   void T::f() {}
};

template <class T>
struct A4 : T {
   void T::f() {}
};

A3<A1> x;   // C3240
A3<I> x2;
A4<A2> x3;