class Lazy_Singleton {
private:
Lazy_Singleton() {};
~Lazy_Singleton() {};
Lazy_Singleton(const Lazy_Singleton&) {};
Lazy_Singleton& operator = (const Lazy_Singleton&);
public:
static Lazy_Singleton& getInstance() {
static Lazy_Singleton instance;
return instance;
}
};
class Eager_Singleton {
private:
static Eager_Singleton instance;
private:
Eager_Singleton() {};
~Eager_Singleton() {};
Eager_Singleton(const Eager_Singleton&) {};
Eager_Singleton& operator = (const Eager_Singleton&);
public:
static Eager_Singleton& getInstance() {
return instance;
}
};
Eager_Singleton Eager_Singleton::instance;