[Gc] C++ API enhancement proposal
skaller at users.sourceforge.net
Sun Oct 14 23:31:14 PDT 2007
On Sun, 2007-10-14 at 21:51 -0400, MenTaLguY wrote:
> On Mon, 2007-10-15 at 03:20 +1000, skaller wrote:
> > I beg to differ. The best practice is to use only global POD
> > constants.
> If you want singletons, it's the best way to do them without resorting
> to non-POD constants, period.
Why do you want singletons?
In general there is no such thing as a 'single' anything..
A pity sometimes you have to cope with bad interfaces,
that is one valid reason for single objects .. still,
you should always write your code to accept explicitly
passed pointers even if there is currently no apparent
As soon as you decide there's only one of something
someone will find a use for two. The number of major libraries
completely broken by not following simple 1st year CS design
rules is disgusting. GTK and OpenGL being two examples which
are new enough that there is no excuse whatsoever.
I would guess libgc collector would be portable and work
on all platforms modulo only functions to find the stack
for each thread, if code didn't use static store.
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
More information about the Gc