#include<iostream>
#include"MyString.h"
#include<string>
using namespace std;
class President{
private:
President(){};
President(const President&);
const President& operator=(const President&);
string Name;
public:
static President& GetInstnce(){
static President OnlyInstance;
return OnlyInstance;
}
string GetName(){
return Name;
}
void SetName(string InputName){
Name = InputName;
}
};
int main(){
//单例模式
President& OnlyPresident = President::GetInstnce();
OnlyPresident.SetName("Abraham Lincoln");
cout<<"The name of the President is: ";
cout<<President::GetInstnce().GetName()<<endl;
return 0;
};