C++中类模板继承问题 派生类报错: error: expected class-name before '{' token
#include<iostream>usingnamespacestd;template<classT>classTwoOperators{private:T_x;T_y...
#include <iostream>
using namespace std;
template <class T>
class TwoOperators{
private:
T _x;
T _y;
public:
virtual T Sum();
virtual T Product();
virtual T Division();
virtual T Subtraction();
virtual T TakeOver();
}
template <class T>
class Common:virtual TwoOperators{};
int main()
{
} 展开
using namespace std;
template <class T>
class TwoOperators{
private:
T _x;
T _y;
public:
virtual T Sum();
virtual T Product();
virtual T Division();
virtual T Subtraction();
virtual T TakeOver();
}
template <class T>
class Common:virtual TwoOperators{};
int main()
{
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询