Click for commercial
licensing information.
Scott Meyers Training Courses
What's New in Effective C++?
Scott Meyers' Effective C++ has defined good programming in C++ since it first came out in 1991, but since the second edition in 1998, C++ has changed, the people using it have changed, and accepted best practices have changed, too. This seminar — based on new information in the 2005 third edition of the book — summarizes the most important advice for experienced C++ developers. There is no better way to bring C++ programmers up to date on cutting edge considerations, technologies, and practices than this seminar, chock-full of Meyers' signature insights, explanations, and examples.
Course Highlights
Participants will gain:
- An understanding of the importance of using objects to manage resources.
- Insights into how templates and exceptions affect "classic" C++ best practices.
- An overview of a number of design alternatives to virtual functions, including their comparative pros and cons.
- Familiarity with the importance of TR1 and Boost.
Each attendee will also receive a copy of Effective C++, Third Edition.
Who Should Attend
Experienced C++ developers will get the most out of this seminar, but the only prerequisite is familiarity with the basic features of C++, including templates and exceptions. Familiarity with existing editions of Effective C++ is not required.
Format
Lecture and question/answer. There are no hands-on exercises, but participants are welcome to use their computers to experiment with the course material as it is presented.
Length
One full day (six to seven lecture hours).
Detailed Topic Outline
- Resource Management:
- Use objects to manage resources
- Resource acquisition is initialization (RAII)
- std::auto_ptr
- std::tr1::shared_ptr
- TR1 and Boost
- Think carefully about copying behavior in resource-managing classes
- Store resources in objects in standalone statements
- Instruction reordering and resource leaks
- Use objects to manage resources
- Design and Implementation of Classes and Functions:
- Prefer non-member non-friend functions to member functions:
- The value of encapsulation
- How removing member functions increases class encapsulation
- Using namespaces to associate classes and functions
- Strive for exception-safe code
- Definition of "exception-safe"
- The basic, strong, and nothrow guarantees
- Exception specifications and exception-safety guarantees
- Approaches to the strong guarantee
- Careful statement ordering
- Copy and swap
- Dependencies among exception-safety guarantees
- Consider alternatives to virtual functions:
- The nonvirtual interface idiom (NVI)
- Using function pointers
- Using std::tr1::function objects
- The classic Strategy pattern
- The static Strategy pattern
- Prefer non-member non-friend functions to member functions:
- Templates and Generic Programming:
- Understand implicit interfaces and compile-time polymorphism:
- Explicit interfaces
- Implicit interfaces
- Making implicit interfaces explicit
- Runtime vs. compile-time polymorphism
- Use member function templates to accept "all compatible types"
- Member function templates and compiler-generated member functions
- Define non-member functions inside templates when type conversions
are desired
- Template argument deduction vs. function overloading resolution
- An algorithm for choosing among member functions, non-member functions, and friends
- Use traits classes for information about types
- Understand implicit interfaces and compile-time polymorphism:
- Sources for Additional Information
For more information on this course, contact Scott directly.

