When instantiating Singleton<>, how does the compiler know what constructors are available for class Updater? I'm referring to the bolded line.
(This code is greatly reduced, but I see something just like it running around in the wild.)
There is something that I do not understand about the order in which the compiler sees symbols. Thanks!Code:template<typename SingletonClass> class Singleton { public: Singleton() {} static SingletonClass & instance(); private: static auto_ptr<SingletonClass> ptr; // and the other constructors }; template <typename SingletonClass> SingletonClass & Singleton<SingletonClass>::instance() { if (ptr.get() == 0) ptr.reset(new SingletonClass()); return *ptr; } // . . . class Updater : public Singleton<Updater> { // constructors and methods and all that.. };