Chapter 5. Object Access Models

We've talked a lot about what the lifetime of an object means, both in terms of what actions are performed by the compiler on our behalf (with our functions), and in terms of the details of the mechanisms involved. Now I'd like to talk about lifetime issues as they pertain to the relationships between object instances, in particular between container objects and the client code that uses their contained objects. (Note that when I refer to a container in this section, I mean both containers in the standard sense—list, vector, map—and any composite types that “contain” their member variables.)

Vouched Lifetimes

This is the simplest and most efficient manner in which one object can allow another access to the objects ...

Get Imperfect C++ Practical Solutions for Real-Life Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.