C
Chris Forone
its ok to return *this as reference (C++ FAQ L).
but is it also in singleton pattern (ctor example below)?
Timer* Timer::sole(0); // static
Timer& Timer::Get() // static
{
return sole ? *sole : *(sole = new Timer);
}
i think it isnt only if using new (std::nothrow),because of exeption
handling!?
HAND, Chris
but is it also in singleton pattern (ctor example below)?
Timer* Timer::sole(0); // static
Timer& Timer::Get() // static
{
return sole ? *sole : *(sole = new Timer);
}
i think it isnt only if using new (std::nothrow),because of exeption
handling!?
HAND, Chris