Ray's playground

 

2011年4月10日

boost::array

摘要: boost::array — STL compliant container wrapper for arrays of constant size1#include<iostream>2#include<string>3#include<boost/array.hpp>4usingnamespacestd;5usingnamespaceboost;67intmain()8{9array<int,4>intArray={1,2,3};10for(array<int,4>::iteratorit=intArray.begin();it! 阅读全文

posted @ 2011-04-10 21:19 Ray Z 阅读(318) 评论(0) 推荐(0) 编辑

Item.55: Familiarize yourself with Boost.(Effective C++)

摘要: Boost is a community and web site for the development of free, open source, peer-reviewed C++ libraries. Boost plays an influential role in C++ standardization. Boost offers implementations of many TR1 components, but it also offers many other libraries, too. 阅读全文

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

Item 54: Familiarize yourself with the standard library, including TR1(Effective C++)

摘要: The primary standard C++ library functionality consists of the STL, iostreams, and locales. The C99 standard library is also included. TR1 adds support for smart pointers (e.g., tr1::shared_ptr), generalized function pointers (tr1::function), hash-based containers, regular expressions, and 10 other. 阅读全文

posted @ 2011-04-10 11:27 Ray Z 阅读(162) 评论(0) 推荐(0) 编辑

Item 53: Pay attention to compiler warnings.(Effective C++)

摘要: Take compiler warnings seriously, and strive to compile warning-free at the maximum warning level supported by your compilers. Don't become dependent on compiler warnings, because different compilers warn about different things. Porting to a new compiler may eliminate warning messages you've 阅读全文

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

Item 52: Write placement delete if you write placement new(Effective C++)

摘要: When you write a placement version of operator new, be sure to write the corresponding placement version of operator delete. If you don't, your program may experience subtle, intermittent memory leaks. When you declare placement versions of new and delete, be sure not to unintentionally hide the 阅读全文

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

Item 51: Adhere to convention when writing new and delete(Effective C++)

摘要: operator new should contain an infinite loop trying to allocate memory, should call the new-handler if it can't satisfy a memory request, and should handle requests for zero bytes. Class-specific versions should handle requests for larger blocks than expected. operator delete should do nothing i 阅读全文

posted @ 2011-04-10 01:17 Ray Z 阅读(193) 评论(0) 推荐(0) 编辑

导航