
28 Jun
2011
28 Jun
'11
9:34 a.m.
On Tue, Jun 28, 2011 at 07:13, Ben Robinson <icaretaker@gmail.com> wrote:
The source is now available on GitHub at:
I started to read it and I have a minor suggestion : would it be a good idea to also allow creation/destruction of the object without using create() and destroy()? class TheObject : public singularity<TheObject, global_access > {...} m_the_object = new TheObject(); ... // in another module auto& the_object = TheObject::get(); // ok if run after the previous code ... // in another function delete m_the_object; // now TheObject::get() will throw I've seen such possibility in Singleton implementations and found it useful but I'm not sure if it's a good idea because of the destruction function throwing. Joël Lamotte