I have a class called WaterJug
In one of the WaterJug
methods, I want to access a global Set<WaterJug>
.
However, when I define the Set<WaterJug>
before the class WaterJug {}
I get an error Use of undeclared identifier
.
When I define the Set<WaterJug>
after the class, then I get Use of undeclared identifier
when trying access the set in the class's methods.
Is there anyway around this?
set<WaterJug> jug;
class WaterJug {
public:
int capA, capB, capC;
int goalA, goalB, goalC;
int currA, currB, currC;
//tons of methods...
};