Skip to content

Files

Latest commit

 

History

History

SingletonPattern

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Singleton Pattern

For when you for some reason need a singleton. I don't recommend using this but added it for completeness. This is thread-safe due to Magic Statics.

Supported from VC++2015 and GCC C++11.

One suggested alternative to a singleton is to throw an exception when trying to instantiate x objects.

UML

alternative text