71、72、73
来源:互联网 发布:广电网络运维工作总结 编辑:程序博客网 时间:2024/05/21 01:45
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <memory>
using namespace std;
#include <fstream>
#include <string>
#include <map>
#include <memory>
using namespace std;
class SomeClass
{
public:
SomeClass(string name):str(name){cout << str <<": In construct function."<<endl;}
~SomeClass(){cout<< str <<": In Destruct function."<<endl;}
SomeClass(SomeClass &){cout<<str <<": In copy construct function."<<endl;}
SomeClass & operator = (SomeClass &){cout<<str <<": In assignment function."<<endl;return *this;}
private:
string str;
};
{
public:
SomeClass(string name):str(name){cout << str <<": In construct function."<<endl;}
~SomeClass(){cout<< str <<": In Destruct function."<<endl;}
SomeClass(SomeClass &){cout<<str <<": In copy construct function."<<endl;}
SomeClass & operator = (SomeClass &){cout<<str <<": In assignment function."<<endl;return *this;}
private:
string str;
};
int main()
{
auto_ptr<SomeClass> ptr1(new SomeClass("ptr1"));
auto_ptr<SomeClass> ptr2(new SomeClass("ptr2"));
{
auto_ptr<SomeClass> ptr1(new SomeClass("ptr1"));
auto_ptr<SomeClass> ptr2(new SomeClass("ptr2"));
*ptr2 = *ptr1;
{
auto_ptr<SomeClass> ptr3(ptr2);
ptr1 = ptr3;
}
auto_ptr<SomeClass> ptr3(ptr2);
ptr1 = ptr3;
}
return 0;
}
}
#include <iostream>
using namespace std;
using namespace std;
class CException
{
public:
CException() {}
virtual ~CException() {}
void Reason() {cout << "CException" << endl;}
};
{
public:
CException() {}
virtual ~CException() {}
void Reason() {cout << "CException" << endl;}
};
void fn1()
{
throw CException();
}
{
throw CException();
}
int main()
{
try {
fn1();
} catch (CException& ce) {
ce.Reason();
}
return 0;
}
阅读全文
0 0
- 71、72、73
- PE 71 72 73 Farey Neighbours (sequence) (farey序列)
- 第71+72+73+74讲 static静态方法+面向对象三大特征(1)
- 【LeetCode71-80】71目录简化72DP问题73巧妙利用0位置76通用substr问题精妙模板79DFS+回溯
- LM4F120 Register 72 73 74: System Handler Priority
- 一个关于线程的经典面试题,要求用三个线程,按顺序打印1,2,3,4,5.... 71,72,73,74, 75. 线程1先打印1,2,3,4,5, * 然后是线程2打印6,7,8,9,10, 然后是
- 73
- 73
- 73
- 5月22日起郑州72路、73路、215路恢…
- 71
- 71
- 71
- 71
- 71
- 71
- 72
- 72
- Android Studio之删除模块和删除项目
- 单例和多例的区别
- 68、69、70
- 【整理归纳】Linux中 find查找命令
- eclipse 查找替换小技巧
- 71、72、73
- Linux内核中的管道
- java TCP/IP Socket编程-----纵览全书-----笔记1
- Apache服务器搭建配置要点
- 基于深度残差网络的图像识别案例
- bzoj2818 gcd 欧拉函数(前缀和)
- vs中自动生成时序图
- day07 面向对象(构造方法、static类变量)
- task_struct(进程描述符)