调整C++ 代码
This commit is contained in:
25
cppLib/Calculate.h
Normal file
25
cppLib/Calculate.h
Normal 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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user