BOOK / SOURCE & READING RECORD
More Effective C++: 35 New Ways to Improve Your Programs and Designs
Scott Meyers
Original first edition, 1995/1996; additional accessed Chinese composite PDF credits ZHC for Items1–28 and WQ for Items29–35; exact published translation edition unverified
More Effective C++: 35 New Ways to Improve Your Programs and Designs
Have fully read all technical items Items 1–35 of the public 267-page Chinese composite PDF (PDF pages 11–240), the recommended reading and auto_ptr appendix (pages 240–247), and two additional articles (pages 247–267), and have directly verified all 31 embedded figures in the main text as well as the notation notes on page 9 by inspecting the figures. “full” refers only to all substantial chapters of this public Chinese text, not page-by-page verification of the English original or a commercial Chinese edition: the commercial translation’s edition is unverified; the first 4–5 pages of Chinese appear as boxes in both the source PDF and the images, were not recovered, and are not counted as technical main text. The publisher’s English Item 33 was also read for cross-checking; historical translator notes and code errors should not be treated as C++20 rules.
Edition, actual reading range, and original sources →Sources
Public Chinese composite PDF, private analysis only
267 pages; all technical text of Items 1–35 main text PDF pages 11–240 and appendix pages 240–267 has been read, and all 31 embedded figures in the main text have been directly verified. The first 4–5 pages of the source file have missing characters and are not counted as read; mixed translator credits are not equivalent to a verified commercial Chinese edition.
The research copy is not linked from this site.
- More Effective C++ Item 33
Complete Item 33 main text; partial assignment under public inheritance, heterogeneous assignment, abstract interfaces and concrete leaves.
- More Effective C++ Item 5 truncated excerpt
Only the visible discussion of implicit conversions and the array mistaken-comparison example; the page terminates mid-way.
- More Effective C++ Item 9 truncated excerpt
Resource cleanup, exception exits, historical auto_ptr solutions, up to the start of the GUI example.
- More Effective C++ Item 10 truncated excerpt
Construction failure and bare resource leaks, up to the delete fragment in catch; the original HTML is also truncated.
- InformIT catalog and 35-item contents
Edition, 35-item table of contents, and purchase entry.
Base-class assignment is not polymorphic copying
Full English publisher Item 33; Chinese composite PDF Items 9–10 (pages 41–54), 33 (pages 219–229)
After fully reading Item 33, what is worth retaining is the method of reviewing the interface, not adding an abstract layer whenever inheritance is seen. If the base class exposes assignment, callers can update only part of the object through a base-class reference; if assignment is made virtual, one must also handle the problem of the two ends having different dynamic types. A reasonable interface should first state whether copying means replacing a value, modifying an existing entity, or producing a new entity. Read-only polymorphic services often do not need public base-class assignment at all; restricting it to the protected region can shrink the error space, while concrete leaves can still have normal value semantics. After C++11 one can use final and type traits to make these intents explicit, but final cannot be treated as a substitute for protecting base-class assignment. The book’s auto_ptr is a historical facility and should not be brought into new C++20 code.
Retain the problem analysis; replace outdated implementation premises
Chinese composite PDF Items 14–15 (pages 67–74), 20 (pages 90–94), 29–30 (pages 152–193)
After reading the full set of Chinese items, the most important thing to prevent is mistaking historical implementation capabilities for today’s language limitations. The reference-counting and proxy discussion reveals that after a borrowed pointer escapes, shared writes destroy value semantics; this remains a good question when reviewing custom data structures, but one should not conclude from it that modern std::string uses copy-on-write. The temporary-objects chapter correctly emphasizes not returning local references, yet treats return-value optimization as an optional compiler capability; since C++17 certain prvalue returns construct the result directly, while named local returns remain a different case. The exception chapter’s dynamic exception specifications, old measurements of exception overhead on the normal path, and workarounds for lack of explicit are also suitable only as historical material. First identify the invariants being maintained, then choose current standard facilities; that is more reliable than reproducing old code.
Related fundamentals
Deep copy, shallow copy, and the Rule of Zero / FiveAbstract class and pure virtual function definitionsStatic and Dynamic Polymorphism, Slicing, and RTTIRAII: Give Cleanup Responsibility to Objects