I am implementing the singleton design pattern in a school assignment, and this is my class header file:
class Scheduler { public: static Scheduler * instanc
Your static singleton instance pointer should be a class member. Currently it is just a free pointer.
class Scheduler { // as before private: Scheduler(); static Scheduler* _singleton; // declare it in the class };
and in the implementation file:
Scheduler * Scheduler::_singleton = 0;