课程说明
C++ 范围之广,可谓是个十分复杂 (也许最复杂) 的语言。落实各个细节,内化为良好的编程风格,十分有益。
课程特色
本课程以业界极富盛名之《Effective C++》为蓝本,从中取出最有价值的专家经验 (expertise),加上我个人的补充。
课程对象
C++ 中高阶学员
课程大纲
Item 13: Use objects to manage resources
Item 54: Familiarize yourself with the standard library, including TR1
Item 55: Familiarize yourself with Boost
Item 14: Think carefully about copying behavior in resource-managing classes
Item 5: Know what functions C++ silently writes and calls
Item 6: Explicitly disallow the use of compiler-generated functions you do not want
Item 7: Declare destructors virtual in polymorphic base classes
Item 29: Strive for exception-safe code
Item 11: Handle assignment to self in operator=()
Item 12: Copy all parts of an object
Item 32: Make sure public inheritance models 3is-a2
Item 34: Differentiate between inheritance of interface and inheritance of implementation
Item 36: Never redefine an inherited non-virtual function
Item 38: Model 3has-a2 or 3is-implemented-in-terms-of2 through composition
Item 39: Use private inheritance judiciously
Item 2: Prefer consts, enums, and inlines to #defines
Item 3: Use const whenever possible
Item 4: Make sure that objects are initialized before they1re used
Item 18: Make interfaces easy to use correctly and hard to use incorrectly
Item 20: Prefer pass-by-reference-to-const to pass-by-value
Item 21: Don1t try to return a reference when you must return an object
Item 22: Declare data members private
Item 26: Postpone variable definitions as long as possible
Item 28: Avoid returning 3handles2 to object internals
Item 50: Understand when it makes sense to replace new and delete
Item 9: Never call virtual functions during construction or destruction
Item 25: Consider support for a non-throwing swap
Item 27: Minimize casting
Item 31: Minimize compilation dependencies between files
Item 44: Factor parameter-independent code out of templates