1.分配空间2.记录内存块信息3.调用构造函数(类型萃取)#include<iostream>
#include<string>
#include<list>
#include<assert.h>
usingnamespacestd;
structBlockInfo
{
void*_ptr;
string_file;
int_line;
BlockInfo(void*ptr,constchar*file,in..
分类:
其他好文 时间:
2015-12-26 23:52:18
阅读次数:
387
迭代器(一种泛型指针类型)是容器和算法的胶合剂。在使用中,经常会使用迭代器相关的类型。
来看迭代器类型萃取机。
文件:stl_iterator_base.h
定义迭代器种类的五种类型,这五种类型不包含任何数据,只是用来作为参数传递给算法,
这时会根据编译器的函数重载来选择最合适的对迭代器的操作,比如,对一个迭代器加上n,
对于forword类型的,只能循环n次,一次加一,而对于random类...
分类:
其他好文 时间:
2015-08-30 15:55:47
阅读次数:
217
不知道怎么评价这个特性。。。代码#include#include//继承integral_constant可以方便写静态变量structGetSize: std::integral_constant{};templatestruct integral_my{staticconst T value =...
分类:
编程语言 时间:
2015-08-19 23:18:59
阅读次数:
270