In the singleton document,
- Code: Select all
#include "Poco/SingletonHolder.h"
class MySingleton
{
public:
MySingleton()
{
// ...
}
~MySingleton()
{
// ...
}
// ...
static MySingleton& instance()
{
static Poco::SingletonHolder<MySingleton> sh;
return *sh.get();
}
};
Cuz we cannot make the constructor and destructor private or protected,
doesn't it make it useless because we can still instantiate more than one instances from the class?
Thanks.





