调整C++ 代码

This commit is contained in:
2024-05-28 19:32:20 +08:00
parent de31b79465
commit 1ee0ec29b7
13 changed files with 62 additions and 23 deletions

25
cppLib/Calculate.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef CPPLIB_LIBRARY_H
#define CPPLIB_LIBRARY_H
#include <string>
#include "CalculateInfo.h"
class Calculate {
public:
static Calculate& getInstance();
int add(int a, int b);
CalculateInfo getInfo();
// 删除拷贝构造函数和赋值运算符
Calculate(const Calculate&) = delete;
Calculate& operator=(const Calculate&) = delete;
private:
// 构造函数和析构函数私有化
Calculate() {}
~Calculate() {}
};
#endif //CPPLIB_LIBRARY_H