摘抄:
55 specific ways to improve your programs and designs.
-------------------------------------------------------------------------------------
Introduction
- General design strategies
- The nuts and bolts of specific language features.
It’s a collection of 55 specific suggestions (I call them Items) for how you can improve your programs and designs.
---------------------------------------------------------------------------------------
Guidelines in this book, by their nature, have exceptions. That’s why each Item has an explanation. The explanations are the most important part of the book.
----------------------------------------------------------------------------------------
Blind application of the Items in this book is clearly inappropriate, but at the same time, you probably shouldn’t violate any of the guidelines without a good reason.
----------------------------------------------------------------------------------------
Read carefully when you see what appears to be an assignment, because the “=” syntax can also be used to call the copy constructor: Widget w3 = w2; // invoke copy constructor!
----------------------------------------------------------------------------------------
If a new object is being defined (such as w3 in the statement above), a constructor has to be called;
----------------------------------------------------------------------------------------
The STL is the Standard Template Library, the part of C++'s standard library devoted to containers(e.g., vector, list, set, map, etc), iterators (e.g., vector<int>::iterator, set<string>::iterator, etc.), algorithms(e.g., for_each, find, sort, etc.), and related functionality.
----------------------------------------------------------------------------------------
Naming conventions are like: mf means member functions
Threading considerations: The book is not about multithread programming with C++, but we can get useful tips when confront a multithread problem.
----------------------------------------------------------------------------------------
TR1 and Boost
TR1 ("Technical Report 1" ) is a specification for new functionality being added to C++'s standard library. This functionality takes the form of new class and function templates for things like hash tables, reference-counting smart pointers, regular expressions, and more. All TR1 components are in the namespace tr1 that's nested inside the namespace std.
Boost is an organization and a web site offering portable, peer-reviewed, open source C++ library. Most TR1 functionality is based on work done at Boost. and until compiler vendors include TR1 in their C++ library distributions, the Boost web site is likely to remain the first stop for developers looking for TR1 implementations. Boost offers more than is available in TR1, however, so it’s worth knowing about in any case.