Boost logo

Boost Users :

From: gast128 (gast128_at_[hidden])
Date: 2007-02-20 12:52:17


Hello Robert,

the problem is related to use of singleton, which have many problems as
described in Alexandrescu. We have singletons a la:

class Singleton
{
public:
   static Singleton* Instance()
   {
      if (ms_pInstance == NULL)
      {
         ms_pInstance = new Singleton
      }
      return ms_pInstance;
   }

private:
   Singleton()
   {
      atexit(&Destroy);
   }

   static void Destroy()
   {
       delete ms_pInstance;
   }

   static Singleton* ms_pInstance;
};

I was hoping for some sort of work around in which the serialization library
could be fooled to initialise itself with some simple function calls, but
indeed tackling the singleton problem would be more fundamental.

wkr,
me


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net