摘要: vector。支持尾部添加/删除数据操作。// STL.cpp : 定义控制台应用程序的入口点。////vector是一个连续的向量,相当于数组。vector不建议除了尾部之外的数据添加删除操作。//vector::iterator 迭代器#include "stdafx.h"#include#in... 阅读全文
posted @ 2014-06-24 17:17 击进的Cocos 阅读(315) 评论(0) 推荐(0) 编辑
摘要: auto_ptr 不可被共享,只能指向一个对象auto_ptr在构造时获取对某个对象的所有权(ownership),在析构时释放该对象。我们可以这样使用auto_ptr来提高代码安全性:int* p = new int(0);auto_ptr ap(p);从此我们不必关心应该何时释放p, 也不用担心... 阅读全文
posted @ 2014-06-24 11:55 击进的Cocos 阅读(223) 评论(0) 推荐(0) 编辑
摘要: pair 提供了一对一的关系#include "stdafx.h"#include#include //#includeusing namespace std;int _tmain(int argc, _TCHAR* argv[]){ pairoPoint; //必须包含std ... 阅读全文
posted @ 2014-06-24 10:42 击进的Cocos 阅读(287) 评论(0) 推荐(0) 编辑