gpt4 book ai didi

c++ - 错误 C2923 : 'std::vector' : 'Edge' is not a valid template type argument for parameter '_Ty' ?

转载 作者:太空宇宙 更新时间:2023-11-04 15:15:04 26 4
gpt4 key购买 nike

<分区>

你好...

    #ifndef Node_H
#define Node_H
#include <vector>
#include <stack>
#include <string>
#include <iostream>
#include "Edge.h"
#include "CongestionMap.h"
using namespace std;
class Node
{

public:
Node(){ visit = false;};
Node(int id);
~Node();
int getID();
void setLocation(int &row, int &col, GridCell *Gc);;
void displayList();

private:
int row;
int col;
int id;
bool visit;
int parrent;
int distance;
typedef vector< Edge > adjNodeList;

};
#endif

当我编译项目时出现错误project\node.h(43): error C2065: 'Edge': 未声明的标识符project\project\node.h(43): error C2923: 'std::vector' : 'Edge' 不是参数 '_Ty' 的有效模板类型参数... 请帮我 ...边缘.h

#ifndef Edge_H
#define Edge_H
#pragma once
#include <vector>
#include <stack>
#include <string>
#include <iostream>
#include "Node.h"

using namespace std;

class Edge
{
public:
Edge() {};
Edge(Node *firstNode, Node *secNode, int inCost);
~Edge(void);

Node* getDstNode();
Node* getOrgNode();
int getCost();

private:
Node *orgNode;
Node *dstNode;
int cost;

};
#endif

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com