A simple can easily encapsulate normal C++ classes into singleton classes, can support both classes with and without instance() function, and with several singleton instance management functions. Some usage examples are provided in main.cpp.
- For Linux systems
-
Go to the project directory and execute:
cmake -B./build
-
Go to the build directory and run the following command:
./UniSignleton
- For Windows systems
-
Go to the project directory in the console and execute:
cmake -B./build -G"Visual Studio 17 2022"
-
Go to the build directory in the file browser and double-click UniSingleton.sln;
-
Use Visual Studio to compile the project.