我有一个名为WaterJug
在其中一种WaterJug
方法中,我想访问全局Set<WaterJug>
。
但是,当我在Set<WaterJug>
之前定义class WaterJug {}
时,我收到错误Use of undeclared identifier
。
当我在课程后定义Set<WaterJug>
时,在尝试访问类方法中的集合时,我得到Use of undeclared identifier
。
到底有没有?
set<WaterJug> jug;
class WaterJug {
public:
int capA, capB, capC;
int goalA, goalB, goalC;
int currA, currB, currC;
//tons of methods...
};