https://github.com/bunnysakura/singleton-cpp
C++单例模板
https://github.com/bunnysakura/singleton-cpp
header header-only headeronly singleton singleton-class
Last synced: about 1 month ago
JSON representation
C++单例模板
- Host: GitHub
- URL: https://github.com/bunnysakura/singleton-cpp
- Owner: BunnySakura
- License: bsd-3-clause
- Created: 2024-03-22T08:49:53.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-22T09:02:35.000Z (over 1 year ago)
- Last Synced: 2025-07-14T18:44:11.476Z (3 months ago)
- Topics: header, header-only, headeronly, singleton, singleton-class
- Language: C++
- Homepage: https://333rd.net/zh/posts/read/c++%E5%8D%95%E4%BE%8B%E6%A8%A1%E6%9D%BF/
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# singleton-cpp
*C++单头文件实现的单例模板。*
## 使用
- 直接使用(推荐)
```cpp
Singleton::GetInstance() // 无参构造
Singleton::GetInstance(... Args) // 传入任意参数进行构造
```- 继承派生
```cpp
class C : public Singleton
```