From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-02-14 10:12:01
Sérgio Vale e Pace wrote:
> On Mon, 14 Feb 2005 16:00:08 +0200, Peter Dimov <pdimov_at_[hidden]>
>> This is not a problem. The designer of Example does permit such use:
>> Example a;
>> Example b;
> Sorry for the ignorance, but then what´s the point of using the
> singleton if Example is not suposed to be a singleton?
A class that supports an arbitrary number of instances also supports a
single instance. It's not a programming error to use one instance of Example
as a "singleton" to solve the initialization order problem (the only
legitimate use of the "singleton pattern", in my opinion).
The reverse, of course, is not true. If a class only supports a single
instance the programmer shouldn't be allowed to create multiple instances.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk