Re: [Boost-users] how to make a vector to derivedClass::create() methods

Victor.Whiskey.Yankee wrote:
Thank you Steve for your solution, it is working fine. I have a nice
thread-safe singleton factory now, and it is generic
using templates.
I am now trying to make my derived classes register with the factory
automatically, but cannot figure it out.
I basically have this:
template

All,
Again thank you Steven for your great suggestion, though I have compiler
problems, using 1.38, 1.37, and even 1.33.1.
I am putting my code here so maybe I am missing something simple.
Thank you,
Victor
=====code starts here=======
// for thread-safe singleton
#include

Steven Watanabe wrote:
Is compiles now. Thanks! I guess the "thread safe singleton" recipe is having difficulty. It fails a boost assertion in method static T& instance() trying to return *t when ask for an instance of "z" in the test main. Interesting finding. If I move the myARestistrar and myBRegistrar to be inside main, then everything works. But must auto-register. -Vic
participants (2)
-
Steven Watanabe
-
Victor Whiskey Yankee