$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Sohail Somani (sohail_at_[hidden])
Date: 2007-12-05 16:53:33
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