Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-08-07 13:07:21


--- In boost_at_y..., John Max Skaller <skaller_at_m...> wrote:
> williamkempf_at_h... wrote:
>
> > Once methods are not singletons. The classic reason for their
need
> > is to synchronize the creation of global data.
>
> Right. But global data is a singleton. :-)

Not by the definition of singleton that I'm aware of. A singleton is
a design pattern for a type with controlled construction semantics,
typically used to insure only one instance may be created. Global
data is simply an object instance visable at global scope. It would
be just as valid to call an instance declared at block scope to be a
singleton by this stretch of the meaning.

> In any case, I accept that people want to do bad designs
> and use global data :-) it's in the language, so I guess
> you have to support it in a threading extension.
> Thanks for explanation.

Class statics result in the same thing. For that matter, block
statics do as well. None of these uses are "bad designs", and every
langauge I'm aware of supports at least one of these forms
of "global" data.

Bill Kempf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk