From: Andrew S. <ans...@mi...> - 2002-06-27 03:33:25
|
Ah... I see. That was the ACE approach. You could take the KDE approach which was to make a Kglobals class and make all your globals public static members of that class. class Exult { static MyClass game_window; }; ... Exult::game_window.foo(); Something like that. andy > -----Original Message----- > From: Jeff Freedman [mailto:js...@cy...] > Sent: Wednesday, June 26, 2002 1:30 PM > To: Andrew Sutton; exu...@li... > Subject: Re: [Exult-general] Singletons > > > On Wednesday 26 June 2002 03:09 pm, Andrew Sutton wrote: > > > class MyClass > > { > > friend class singleton<MyClass>; > > static MyClass *g_pMyClass; > > } > > > > See... No inheritance :) and type safe. > > Nice, but it's not the problem I'm trying to solve, which is > that our code is > filled with hundreds of "Game_window::get_instance()", and > will need more > things like that if I start splitting off more pieces from > Game_window. > > I'm trying to create some easily accessible 'globals' without > putting them in > the global namespace. > |