#include <iostream>
#include <string>
using namespace std;
class person{
public:int m_age;
// person(){
// cout<<"默认构造的调用"<<endl;
// }
// person(int age){
// m_age=age;
// cout<<"有参构造的调用"<<endl;
// }~person(){cout<<"析构的调用"<<endl;}person(const person &p){m_age=p.m_age;cout<<"拷贝构造的调用"<<endl;}
}; //1.创建一个类,c++编译器会给每个类都添加至少3个函数
//无参构造(空实现)
//析构函数(空实现)
//拷贝构造(值拷贝)
//void test01(){
// person p;
// p.m_age=18;
// person p2(p);
// cout<<"p2的年龄为"<<p2.m_age<<endl;
//}
//2.写了有参构造,编译器不再提供默认构造,依然提供拷贝构造
void test02(){person p;//cout<<"p2的年龄为"<<p2.m_age<<endl;
}
//3.写了拷贝构造,编译器不再提供其他普通构造int main ()
{//test01();test02();return 0;
}