Chinaunix首页 | 论坛 | 博客
  • 博客访问: 285743
  • 博文数量: 148
  • 博客积分: 4365
  • 博客等级: 上校
  • 技术积分: 1566
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-05 21:38
文章分类
文章存档

2014年(2)

2013年(45)

2012年(18)

2011年(1)

2009年(54)

2008年(28)

我的朋友

发布时间:2013-01-24 23:04:42

对照着cpp primer 5th 中所列的c++ 11特性按章节学习记录下。Chapter 2 Variables and Basic Types1. 新类型 long long,at least as large as long,这个怎么记得早就有了,vs2005好像就支持。2. List Initialization   int i{3}; //用大括号(curly braces)的形式,使用范围比较受限,SBL这.........【阅读全文】

阅读(636) | 评论(0) | 转发(0)

发布时间:2013-01-22 15:36:15

Item 51: Adhere to convention when writing new and deletescott这里给了一个new的大致流程伪代码,非常有用:void * operator new(std::size_t size) throw(std::bad_alloc){ // your operator new might take additional params using namespace std; if (.........【阅读全文】

阅读(330) | 评论(0) | 转发(0)

发布时间:2013-01-22 12:16:11

虽然说默认版本的new/delete是效率最高的,但有时需要定制自己的版本。1.头或尾加入魔术字,验证操作内存是否越界。2.手动控制字节对齐,提高效率等等。3.统计内存的使用等等。4.提高效率,指广义的new,即先申请好内存,统一管理,需要内存时向自己申请,pool模型就是这样吧。等等等等,总之就.........【阅读全文】

阅读(597) | 评论(0) | 转发(0)

发布时间:2013-01-19 00:38:41

Item 49: Understand the behavior of the new-handler先参考:?http://en.cppreference.com/w/cpp/language/new ,回顾下new。PS:这网站看名字就知道不错。最常见的new,像 int *p = new int; 这种称为 new-expression,它的原型两种:::(optional) new (placement_params)(optional.........【阅读全文】

阅读(1291) | 评论(0) | 转发(0)

发布时间:2013-01-18 11:10:47

cpp......【阅读全文】

阅读(686) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册