Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2005-02-14 21:16:18


"Jason Hise" wrote:

> Rob Stewart wrote:
>
>>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.
>
Maybe function

template<.....>
T* unsafe_get_pointer(singleton<T>::pointer&) { ... }

would be enough. Having one more class
for just one function feels as overkill.

Local need for raw pointer should not mean
possibly global change in design.

/Pavel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk