The purpose of a singleton is that there is only one instance. An instance of a derived class is also an instance of the singleton. Why is the derived class not the singleton class?
@ LB: A templated singleton parent class can be used to make child singleton classes. He's probably doing this:
1 2 3 4 5 6 7 8 9 10 11 12
template <typename T>
class Singleton
{
private:
// ctors/dtors here to enforce it can't be externally created
public:
T& getInstance()
{
// get instance of child class here
}
};
That said... I don't really understand OP's question about unique_ptr.