Skip to content

Latest commit

 

History

History
12 lines (7 loc) · 589 Bytes

File metadata and controls

12 lines (7 loc) · 589 Bytes

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