I am implementing the singleton design pattern in a school assignment, and this is my class header file:
class Scheduler {
public:
static Scheduler * instance();
~Scheduler();
private:
Scheduler();
};
static Scheduler * _singleton = 0; // WARNING HERE
My problem is that I keep getting this error:
../Scheduler.h:60:20: warning: ‘_singleton’ defined but not used [-Wunused-variable]
And we have to submit assignments with no compilation warnings. How do I get rid of this warning? There's no need for me to use _singleton
in the header file itself so I'm not sure what to do. I know it's stupid, but still...
Ideas?