
On Mon, 14 Feb 2005 16:00:08 +0200, Peter Dimov <pdimov@mmltd.net> wrote:
Sérgio Vale e Pace wrote:
On Sun, 13 Feb 2005 19:20:07 -0500, Jason Hise <chaos@ezequal.com> wrote:
I recently discovered that my singleton could potentially be used in a way other than as a base class. For example, to create and use a singleton instance of a class which could have other ordinary instances as well, one could just do:
class Example { public: void foo ( ) { } };
// elsewhere...
singleton < Example >::pointer ptr; ptr->foo ( );
I believe (as in "I didn´t tested it" :) that using it in this way would allow multiple instances of Example? For example?
singleton<Example>::pointer ptr; Example other;
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?