Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2005-01-09 00:22:54


"Jason Hise" wrote:

> Why does my compiler say that SingletonAllocationHelper < D > doesn't
> have access to D's ctor?
>
[snip]

To use placement new it is needed to have
overloaded new/delete operators (or
overloaded globals).

With the definition bellow the code compiles on Intel:

class D : public Singleton < D >
{
protected:
    D ( )
    {
    }
    void* operator new(size_t, D* p) { return p; }
    void operator delete(void* p, D*) {}
};

/Pavel


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