添加项目文件。

This commit is contained in:
小疯
2022-09-01 16:56:37 +08:00
parent f17a7cb9c8
commit c5a2595302
23 changed files with 4470 additions and 0 deletions

15
include/Singleton.hpp Normal file
View File

@@ -0,0 +1,15 @@
#ifndef __SINGLETON_H__
#define __SINGLETON_H__
//饿汉模式
#define SINGLETON_DEFINE_S(TypeName) \
static TypeName* Get() \
{ \
static TypeName type_instance; \
return &type_instance; \
} \
\
TypeName(const TypeName&) = delete; \
TypeName& operator=(const TypeName&) = delete
#endif // __SINGLETON_H__