Listing 4
template < class T, template <class> class CreationPolicy, template <class> class LifetimePolicy, template <class> class ThreadingModel > void SingletonHolder<T, CreationPolicy, LifetimePolicy, ThreadingModel>::MakeInstance() { ... if (!pInstance_) { if (destroyed_) { LifetimePolicy<T>::OnDeadReference(); destroyed_ = false; } pInstance_ = CreationPolicy<T>::Create(); LifetimePolicy<T>::ScheduleDestruction( pInstance_, &DestroySingleton ); } }