Boost logo

Boost :

From: Pavel Antokolsky aka Zigmar (zigmar_at_[hidden])
Date: 2005-05-06 15:45:14


On 5/6/05, Pavel Vozenilek <pavel_vozenilek_at_[hidden]> wrote:
> Win32 DLLs would need some support - Windows does not resolve
> statics when a DLL is loaded.
>
> Either explicit registering of Singleton infrastructure from each DLL
> would be needed or perhaps using shared segment.

AFAIK there is no platform independent way to deal with shared memory,
if that what you mean.
Regarding the problem, I was thinking of some kind of way to specify
the storage type manually.

For example something like in this fictional example:
--- my_singleton.h
class my_singleton : public boost::singleton_ex< my_singleton,
static_lifetime, manual_storage >
{
   //...
};
--- my_singleton.cpp
my_singleton::storage_type storage;

I'm not proposing such interface, but the idea is to allow to used to
leave the storage object inside the Singleton uninitialized, and allow
him to create it manually where he wants to (i.e. in shared memory or
inside implementation file).

-- 
Best regards,
Zigmar

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk