【发布时间】:2019-03-28 18:28:41
【问题描述】:
我正在尝试创建一个类,其私有成员必须访问在同一类中使用公共访问定义的结构。我正在使用 VS Code 编写代码。当我尝试编写私有成员函数时,它说结构标识符未定义。
class Planner
{
private:
typedef std::pair<int, int> location;
std::vector<location> obstacles;
Pose next_state(const Pose& current_state, const Command& command);
public:
Planner(/* args */);
virtual ~Planner();
/* data */
struct Command
{
unsigned char direction;
unsigned char steering;
};
struct Pose
{
int x;
int y;
int theta;
};
struct Node
{
Pose pose;
int f;
int g;
int h;
};
};
在这里,它说'标识符“姿势”未定义'。我想了解这里发生了什么。
【问题讨论】:
标签: c++