This is a repository for notes I took when reading the book Effective C++ Third Edition: 55 Specific Ways to Improve Your Programs and Designs by Scott Meyers. The note contains of what are the important concepts and examples from the book. Note that this is not a redistribution of the content of the book, just some note I took for me to learn more about C++ programming language and design, and it would be a more convenient way to check for some coding decorum. Instead, I strongly recommend every C++ programmers to purchase this book and read it through, and check back here for concepts rewind. Hopefully this can also help others who wish to improve their design of C++ programs.
- View C++ as a federation of languages
- Prefer consts, enums, and inlines to #defines
- Use const whenever possible
- Make sure objects are initialized before used
- Know what functions C++ silently writes and calls
- Explicitly disallow the use of compiler-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
- Handling assignment to self in
operator=
- Copy all parts of an object