1、删除部分三方库

2、整合ylib为一个lib库
This commit is contained in:
xx
2024-05-26 12:51:32 +08:00
parent 4391d84402
commit ef63cfd6aa
9264 changed files with 24373 additions and 1648659 deletions

View File

@@ -0,0 +1,33 @@
#pragma once
#include <string>
#include <iostream>
/**
* 基础错误类
*/
namespace ylib
{
// 单例基类模板
template <typename T>
class singleton {
public:
// 获取单例对象的静态方法
static T* getInstance() {
static T instance; // C++11以后局部静态变量的初始化是线程安全的
return &instance;
}
protected:
// 默认构造函数
singleton() = default;
// 禁止拷贝构造函数和拷贝赋值操作
singleton(const singleton&) = delete;
singleton& operator=(const singleton&) = delete;
// 允许析构
virtual ~singleton() = default;
};
}