5 Dec
2007
5 Dec
'07
9:53 p.m.
On Wed, 05 Dec 2007 15:35:35 -0600, Robert Dailey wrote:
How do you prevent people from instantiating Object (in your example)?
Also, I was more or less looking for a member-specific way of doing the singleton access. For example:
Object::instance()
You can do something like: struct Object { friend class singleton<Object>; Object& instance() { return singleton<Object>::instance(); } private: Object(); ~Object(); }; I'm sure there is a nicer way to wrap that up. -- Sohail Somani http://uint32t.blogspot.com