Listing 1
... class Keyboard { public: Keyboard() { print("Keyboard c'tor"); }; ~Keyboard() { print("Keyboard d'tor"); } void print(const char *s) { cout << s << endl; } }; inline unsigned int GetLongevity(Keyboard *) { return 10; } typedef SingletonHolder< Keyboard, CreateUsingNew, SingletonWithLongevity > keyboard; ... keyboard::Instance().echo("Keyboard singleton instantiated");