Poised Solutions Library

Poised Solutions Tech Library

book review
effective C++

Poised Solutions

Effective C++ Book Review

System

Coding

IT Library

Effective C++

Effective C++

Amazon UKAmazon USA
Effective C++
Author:
Scott Meyers
Publisher:
Addison-Wesley
Published:
2007
Pages:
297

Effective C++


Effective C++ Chapters

Effective C++ Chapters
  1. Accustomising Yourself to C++
    • View C++ as a federation of languages.
    • Prefer consts, enums, and inlines to #defines
    • Use const whenever possible.
    • Make sure that objects are initialized before they're used.
  2. Constructors, Destructors and Assignment Operators
    • Know what functions C++ silently writes and calls.
    • Explicitly disallow the use of computer-generated functions you do not want.
    • Declare destructors virtual in polymorphic base classes.
    • Prevent exceptions from leaving destructors.
    • Never call virtual functions during construction or destruction.
    • Have assignment operators return a reference to *this.
    • Handle assignment to self in operator=.
    • Copy all parts of an object.
  3. Resource Management
    • Use objects to manage resources.
    • Think carefully about copying behavior in resources-managing classes.
    • Provide access to raw resources in resource-management classes.
    • Use the same form in corresponding uses of new and delete
    • Store newed objects in smart pointers in standalone statements.
  4. Designs and Declarations
    • Make interfaces easy to use correctly and hard to use incorrectly.
    • Treat class design as type design.
    • Prefer pass-by-references-to-const to pass-by-value.
    • Don't try to return a reference when you must return an object.
    • Declare data members private.
    • Prefer non-member non friend functions to member functions.
    • Declare non-member functions when type conversions should apply to all parameters.
    • Consider support for a non-throwing swap.
  5. Implementations
    • Postpones variable definitions as long as possible.
    • Minimize casting.
    • Avoid returning 'handles' to object internals.
    • Strive for exception-safe code.
    • Understanding the ins and outs of inlining.
    • Minimize compilation dependencies between files.
  6. Inheritance and Object Orientated Design
    • Making sure public inheritance model 'is-a.'
    • Avoid hiding inherited names
    • Differentiate between inheritance of interface and inheritance of implementation.
    • Consider alternatives to virtual functions.
    • Never redefine an inherited non-virtual function.
    • Never redefine a function's inherited default parameter value.
    • Model 'has-a' or 'is-implemented-in-terms-of' through composition.
    • Use private inheritance judiciously.
    • Use multiple inheritance judiciously.
  7. Templates and Generic Programming
    • Understand implicit interfaces and compile-time polymorphism.
    • Understand the two meanings of typename.
    • Know how to access names in templatized base classes.
    • Factor parameter-independent code out of templates.
    • Use member function templates to accept 'all compatible types.'
    • Define non-member functions inside templates when type conversions are desired.
    • Use traits classes for information about types.
    • Be aware of template metaprogramming.
  8. Customizing new and delete
    • Understand the behavior of the new handler
    • Understand when it makes sense to replace new and delete.
    • Adhere to convention when writing new and delete.
    • Write placement delete if you write placement new.
  9. Miscellany
    • Pay attention to compiler warnings.
    • Familiarize yourself with the standard library, including TR1.
    • Familiarize yourself with Boost.
Effective C++ Appendices
  1. Beyond Effective C++
  2. Item Mappings Between Second and Third Editions
  3. Index

C++ Coding


















Poised Solutions Web Development and Web Design by Poised Solutions IT Practice

Guild of Developers  •  PantheonOS  •  Cyber Security