Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-01-17 13:49:03


Tobias Schwinger:

>> Singletons *are* globals.
>
> OK, that was a bit unclear. Let's put it this way:
>
> It's not globals that are evil but accessing them all over the place
> (or "coupling" to use the technical term that describes the problem).

Coupling is why people use singletons. Were there no coupling, there would
be no need to constrain the number of instances. The whole point of having a
single instance it to allow modules to couple themselves to it, and be sure
that they can communicate with other coupled modules via its state.

Note that I'm using singleton here to mean singleton and not to mean "a
solution to the initialization order problem" (which is independent of the
number of instances a type allows).


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