Boost logo

Boost :

From: Jason Hise (chaos_at_[hidden])
Date: 2005-03-04 17:46:12


The singleton library does not work on VC70, and I am having difficulty
figuring out a work-around. Below, I have written a stripped down
version of the singleton hierarchy which demonstrates the problem. Can
someone more familiar with VC70 think of a way to make the code
compile? I suspect I need an extra level of indirection somewhere, but
I'm not sure quite where to put it. Thanks in advance.

template < typename Type >
struct creator
{
    struct creatable : public Type // --- ERROR HERE, SAYS TYPE IS NOT
YET DEFINED ---
    {
    };
};

template < typename Type >
struct lifetime
{
    creator < Type > my_creator;

    struct pointer
    {
    };
};

template < typename Type >
struct singleton
{
    struct pointer : public lifetime < Type >::pointer
    {
    };
};

// client code
struct client_singleton : public singleton < client_singleton >
{
};


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