
14 Feb
2005
14 Feb
'05
10:54 p.m.
Rob Stewart wrote:
That's definitely better. You don't want to make it pretty when someone adds this feature. However, given that the need for this behavior might be just common enough to make this addition to every Singleton type too much pain, how about another class template:
template <typename T> class unsafe_singleton : public singleton<T> { public: //! WARNING: Do not delete the returned pointer! T * unsafe_get() { return this; } };
That's manageable, I can add that. -Jason