Chapter 5. Temporaries
In the large collection of performance issues, not all issues are of equal weight. The significance of a performance item is directly proportional to its cost and the frequency with which it appears in a typical program. It is conceivable that you could write highly efficient C++ code without having a clue about the intricacies of virtual inheritance and the (small) influence it has on execution speed. The generation of temporary objects, on the other hand, definitely does not belong in the category of potentially low-impact concepts. The likelihood of writing efficient code is very small unless you understand the origins of temporary objects, their cost, and how to eliminate them when you can.
Temporary objects may come ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access