我无法应对以下情况:
class someName
{ public:
vector<compound_objectNS::Compound_object*> loadObjectsFromFile(char* fileName);
}
namespace compound_objectNS
{ class Compound_object {here goes it`s defenition}.
}
我从isense收到错误:“ vector不是模板” 我做错了什么? 请帮帮我!提前谢谢。
答案 0 :(得分:1)
在使用#include <vector>
之前,您需要std::vector<>
。
答案 1 :(得分:0)
如果您没有编写using namespace std;
或类似的using
指令,则应编写std::vector
。或者你可能只是忘记了文件开头的#include <vector>
。
此外,在声明compound_objectNS
(完整定义或前向声明)之前,您必须为vector
提供声明。