A Template-Based Singleton in C++

A Template-Based Singleton in C++ Originally published in Chinese on 2020-09-10; this English edition preserves the original scope and technical context. The singleton pattern is a creative design pattern. A class designed using the singleton pattern has only one instance (single instance) in the program. This class is called a singleton class, which provides a global access point. For a discussion of the singleton pattern, please refer to Singleton revisited; Based on these two characteristics, the singleton pattern can have the following implementations: ...

September 10, 2020 · 4 min · Zhengyu Chen