static constructors and destructors in C++
C / C++ / MFC
22
Posts
7
Posters
2
Views
1
Watching
-
Seems to me like a Singleton pattern would do the job better. BTW the standard (well Nov96 draft at least) says a constructor can't have a static modifier (12.1 para 4) if you want official confirmation. i1.2sqrt(u).bcos(ur)sec(c) but b4.isqrt(u).ru/16
I think the Singleton pattern is better suited when you want to expose methods from the one and only instance of a class. But I agree that the ClassFactory pattern can do more than serve up a single class. In fact, it's power lies in the fact that it can serve up specializations of a general base class. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com
-
[removed]
Maybe this article is useful for you: Static Constructor and Destructor in C++