2012年11月26日
摘要: 听名字就是他是为了给我们提供足够的空间而默默的服务着;下面介绍一个简单的空间配置器JJ:allocator//demo3.h#include <new>#include <cstddef>#include <cstdlib>#include <climits>#include <iostream>namespace JJ{ template <class T>//分配内存,相当于构造 inline T* _allocate(ptrdiff_t size,T*){ set_new_handler(0); T* tmp=(T* 阅读全文
posted @ 2012-11-26 20:28 咆哮的蛋蛋 阅读(136) 评论(0) 推荐(0) 编辑