Ray's playground

 

2011年4月9日

Item 50: Understand when it makes sense to replace new and delete(Effective C++)

摘要: There are many valid reasons for writing custom versions of new and delete, including improving performance, debugging heap usage errors, and collecting heap usage information. 阅读全文

posted @ 2011-04-09 21:35 Ray Z 阅读(220) 评论(0) 推荐(0) 编辑

Item 49: Understand the behavior of the new-handler(Effective C++)

摘要: set_new_handler allows you to specify a function to be called when memory allocation requests cannot be satisfied. Nothrow new is of limited utility, because it applies only to memory allocation; subsequent constructor calls may still throw exceptions.1#include<iostream>2usingnamespacestd;34cl 阅读全文

posted @ 2011-04-09 18:46 Ray Z 阅读(187) 评论(0) 推荐(0) 编辑

Item 48: Be aware of template metaprogramming(Effective C++)

摘要: Template metaprogramming can shift work from runtime to compile-time, thus enabling earlier error detection and higher runtime performance. TMP can be used to generate custom code based on combinations of policy choices, and it can also be used to avoid generating code inappropriate for particular . 阅读全文

posted @ 2011-04-09 10:39 Ray Z 阅读(158) 评论(0) 推荐(0) 编辑

导航