Singleton class template More...
|static T &||instance ()|
|Returns the instance of the singleton type. More...|
|T||Type of the singleton|
|A||Allocator for type T|
The Singleton class template can be used to easily implement the Singleton design pattern. It can either be used directly or as a base class.
The follwing example shows how to use the singleton as a base class:
When called for the first time, the singleton instance will be created with the specified alloctaor. All subsequent calls will return a reference to the previously created instance.