What's New in Effective C++?
Referent:
Dr. Scott Meyers
Course Description
Scott Meyers’ Effective C++ has defined good programming in C++ since it was first published in 1991, but since the second edition was published 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 Scott Meyers’ signature insights, explanations, and examples.
Course Outline
- Changes in the C++ landscape since the 1998 second edition.
- Update to "Know what functions C++ silently writes and calls."
- Review of the 4 compiler-generated functions.
- Generalized copy constructors and assignment operators.
- Interactions of generalized copying operations and compiler-generated functions.
- How to exert full control over copying operations.
- Update to "Differentiate among member functions, non-member functions, and friend functions."
- Review of the symmetric type conversion problem.
- Why the solution for non-template classes fails for template classes.
- The inlined friend solution.
- The uninlined friend solution.
- The meaning of encapsulation.
- How non-member functions increase encapsulation and packaging flexibility.
- An updated algorithm for determining how to declare a function associated with a class (or class template).
- New guideline: "Use objects to manage resources."
- Resources and resource leaks.
- RAII: "Resource Acquisition is Initialization."
std::auto_ptr as a resource-managing smart pointer.
tr1::shared_ptr as a resource-managing smart pointer.
- Designing and implementing custom RAII classes.
- An Overview of TR1 and Boost
- New guideline: "Store
newed objects in smart pointers in standalone statements."
- Compiler optimizations, instruction reorderings, and exception-safety.
- Intra-statement reorderings vs. inter-statement reorderings.
- New guideline: "Strive for exception-safe code."
- Definition of "exception-safe" code.
- The basic, strong, and nothrow guarantees.
- Empty exception specifications and the nothrow guarantee.
- "Copy and swap" and the strong guarantee.
- Guidance on choosing a guarantee to offer.
- New guideline: "Consider alternatives to virtual functions."
- The nonvirtual interface idiom (NVI).
- Replacing virtuals with function pointers and the resulting encapsulation problem.
- Replacing function pointers with
tr1::function objects.
- Using the classic (dynamic) Strategy pattern.
- Using the static Strategy pattern.
- Update to "Differentiate between inheritance and templates."
- Explicit vs implicit interfaces.
- Documenting implicit interfaces.
- Making implicit interfaces explicit.
- Run-time vs. compile-time polymorphism.
- New guideline: "Use traits classes for information about types."
- Iterator categories.
- The
std::advance implementation challenge.
- Implementing traits classes.
- Using traits classes.
- Traits in the C++ standard library.
- Traits in TR1.
- Further Reading
Intended Audience
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, as all necessary background is provided.
The material in this seminar is essential for every programmer who wants to be truly effective in his or her use of C++.
Highlights
Attendees will come away with:
- Insights into modern C++ design strategies for applications and libraries.
- A recognition of the importance of using objects to manage resources.
- An understanding of how templates and exceptions affect "classic" C++ best practices.
- An overview of C++ library functionality being added by TR1.
- An understanding of the importance of Boost.
Each attendee will also receive a copy of Effective C++, Third Edition.