Path: utzoo!mnetor!tmsoft!masnet!rose!phil.calvin From: phil.calvin@rose.uucp (PHIL CALVIN) Newsgroups: comp.lang.c++ Subject: Static Constructors Message-ID: <05c3fa6bec3a27f37740@rose.uucp> Date: 29 Mar 91 14:20:00 GMT Organization: Rose Media, ON, CANADA Lines: 50 Forgive me if this is a dead issue, I have never seen mention of it anywhere. Why are STATIC (for lack of a better word) Constructors not allowed?? It seems to me that they could be useful for many types of classes: // // Windows management. // class Window { public: static Window(); // Initializes window management Window(); // Normal object constructor ... }; If static constructors are restricted to having zero arguments, they could simply be implemented in the normal startup code. // // Alternative // class Window { public: static void SetUp(); // Initializes window management Window(); // Constructor ... }; In this case, the main() code (Or somewhere else) must do something like this: main() { Window::SetUp(); // Forget this at yer own risk ... } By the same argument, It would follow that STATIC destructors would be another useful addtion to the language. ...Phil (phil.calvin@rose.uucp) ---