⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 08-1.cpp

📁 effective stl 源代码 code
💻 CPP
字号:
//
// Example from ESTL Item 8
//

#include <iostream>
#include <memory>
#include "ESTLUtil.h"
#include "Widget.h"


int main()
{
	using namespace std;
	using namespace ESTLUtils;

	auto_ptr<Widget> pw1(new Widget);	// pw1 points to a Widget
	auto_ptr<Widget> pw2(pw1);			// pw2 points to pw1抯 Widget;
										// pw1 is set to NULL. (Ownership
										// of the Widget is transferred
										// from pw1 to pw2.)
	pw1 = pw2;							// pw1 now points to the Widget
										// again; pw2 is set to NULL

	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -