|
Boost : |
From: Sérgio Vale e Pace (svpace.forum_at_[hidden])
Date: 2005-02-14 08:00:13
On Sun, 13 Feb 2005 19:20:07 -0500, Jason Hise <chaos_at_[hidden]> 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;
Sérgio
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk