Singletons are a means of ensuring a single, unique copy of an object can ever exist. There are various ways of implementing singletons, the wikipedia has a surprisingly good article on singletons and provides a snippet that utilises the curiously recurring template pattern which is used as the derivation for this form of the singleton.
Include the following at the top of any translation unit that requires compilation of a singleton derived class.
Since it is a template class, no linking is required if you are only using this class.
This singleton is intended to be inherited by a deriving class - this saves the work of actually reinventing the singleton mechanisms whenever you wish to use a singleton.
If you use a macro as shown below, the instance can be conveniently and readably accessed,