#include <iostream>
#include <string>
using namespace std;
//实现关系运算符重载 仿函数
class Person
{
public:Person(int Age,string Name){age = Age;name = Name;}int age;string name;int operator()(){return age ;}bool operator==(const Person& p){if (age == p.age && name == p.name){return true;}else{return false;}}
};void test01()
{Person p1(12, "Kobe");Person p2 = p1;if (p1 == p2){cout << "两个对象相同!" << endl;}else {cout << "两个对象不相同!" << endl;}int add;add = p1();cout << add << endl;
}int main() {test01();return 0;
}