小编Bay*_*Bay的帖子

"错误:期望一个类型,在C++中得到'classname'"

使用以下代码:

template <typename T>
class node {
    [. . .]
};
class b_graph {
friend istream& operator>> (istream& in, b_graph& ingraph);
friend ostream& operator<< (ostream& out, b_graph& outgraph);

public:

    [...]
private:
    vector<node> vertices; //This line
Run Code Online (Sandbox Code Playgroud)

我越来越:

 error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Tp, class _Alloc> class std::vector’
 error: expected a type, got  'node'
 error: template argument 2 is invalid
Run Code Online (Sandbox Code Playgroud)

在指定的行上.在b_graph使用它之前明确定义了节点 - 我在这做了什么?

c++

8
推荐指数
1
解决办法
8739
查看次数

标签 统计

c++ ×1