|
Boost Users : |
Subject: Re: [Boost-users] how to make a vector to derivedClass::create() methods
From: Victor Whiskey Yankee (victor.whiskey.yankee_at_[hidden])
Date: 2009-02-11 23:21:43
Steven Watanabe wrote:
> AMDG
>
> Victor Whiskey Yankee wrote:
>> template <typename BaseType, typename KeyType, typename DerivedType>
>> struct RegisterDerived
>> {
>> RegisterDerived(const KeyType& _key)
>> {
>>
>> GenericFactory<BaseType,KeyType>::instance().registrator<DerivedType>(_key)
>>
>
> This should be
> ...::instance().template registrator<DerivedType>(_key)
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
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