MTSL/h/Singleton.h
youspectrum 2afe10c1f7 Link_List file 改名为 List
List 更改成模板类
添加了 转换函数(重载)
添加了 单链 单体 单键 设计模式
2022-09-27 21:16:39 +08:00

27 lines
325 B
C++

//
// Created by dongl on 22-9-26.
//
#ifndef MSTL_SINGLETON_H
#define MSTL_SINGLETON_H
#endif //MSTL_SINGLETON_H
/// 设计模式 单链 单体 单键
class A{
public:
static A& getInstance();
void setup(){
}
private:
A();
A(const A& rhs);
};
A& A::getInstance() {
static A a;
return a;
}