Dr. Scott Meyers:
Designing and Implementing Effective C++ Classes
Referent:
Dr. Scott Meyers
Teilnehmerkommentare:
"Doc Scott rocks!"
(M. Dillard, EADS Deutschland GmbH)
"Scott ist immer (wieder) eine Bereicherung, ihn zu hören ist Inspiration! (:-)"
(G. Kreuzer, Siemens AG)
"Never had such a detailed discussion about C++ before, thanks!"
(R. Blath, IBM Deutschland Research & Development GmbH)
This seminar, based on Scott’s award-winning Effective C++, covers the most important material that every professional C++ developer needs to know to be truly effective with the language.
Course Highlights
Participants will gain:
- Mastery of the crucial member functions applicable to every class.
- Understanding of the resource acquisition is initialization (RAII) technique for managing resources.
- Insights into the differences among member functions, non-member functions, virtual functions, and non-virtual functions.
- Knowledge of the rules of thumb applied by expert programmers as they design and implement software systems in C++.
Who Should Attend
Systems designers, programmers, and technical managers involved in the design, implementation, and maintenance of software systems written in C++. Participants should already know the basic features of C++ (e.g., classes, inheritance, virtual functions, templates), but expertise is not required. People who have learned C++ recently, as well as people who have been programming in C++ for some time, will come away from this seminar with useful, practical, proven information.
Detailed Topic Outline
- Fundamental Concepts and Functions:
- 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
- Know what functions C++ silently writes and calls
- Explicitly disallow use of implicitly generated member functions you don’t want:
- Declaring functions private
- Inheriting from a base class declaring them private
- Handle copying in classes with pointers:
- Handling the functions yourself
- Using resource-managing objects
- Make destructors virtual in base classes
- Virtual functions and object layout
- 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
- Overloading Operators:
- Handle assignment to self in operator=:
- The problem of aliasing
- Checking for assignment to self
- Using resource-managing objects
- Self-assignment and exception-safety
- Assign to all data members in operator=:
- Partial assignments
- The problem of inheritance
- The copy construction analogue
- Inheritance and Object-Oriented Design:
- Make sure public inheritance models "isa"
- Inheritance and intuition
- Runtime vs. compile-time error detection
- Inheritance and substitutability
- Differentiate between inheritance of interface and inheritance of implementation:
- The meaning of pure virtual functions
- The meaning of "impure" virtual functions
- The meaning of nonvirtual functions
- Never redefine an inherited nonvirtual function
- Model "has-a" or "is-implemented-in-terms-of" through containment
- Sources for Additional Information
Setzen Sie die Scott Meyers Regeln um, mit Hilfe von:

Seminarbeschreibung (pdf)