#include <iostream>
using namespace std;
template <class numtype>
class Compare
{
public:
numtype* x;
};
class test
{
public:
void fun(){
std::cout << "fun" << std::endl;
}
};
int main()
{
Compare<test> a;
a.x = new test();
a.x->fun(); // <-- this line
delete a.x;
return 0;
}图片中的代码只是为了清楚地显示问题。我在main中单击fun()。我收到一个错误,说"Symbol not found: fun“。我该如何修复它?

发布于 2017-11-12 13:52:35
https://stackoverflow.com/questions/47222612
复制相似问题