0

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...

};
songyuanyao
  • 169,198
  • 16
  • 310
  • 405
shakked
  • 783
  • 8
  • 24

0 Answers0