Inside the C++ Object Model

  • ISBN13:


  • ISBN10:


  • Edition: 1st
  • Format: Paperback
  • Copyright: 1996-05-03
  • Publisher: Addison-Wesley Professional

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $64.99 Save up to $16.25
  • Buy Used
    Add to Cart Free Shipping Icon Free Shipping


Supplemental Materials

What is included with this book?


There is a lot of misinformation and myth about the overhead and costs associated with C++. Now Stan Lippman, the acclaimed author of the C++ Primer, answers the call for a book that gives strategy guidelines for C++ programming. Inside the C++ Object Model explains where overhead costs reside and what they actually consist of. The author explains which parts vary by implementation and which are invariant. He tells how the various implementation models arose, points out areas where they are likely to evolve, and explains why they are what they are. This book is a must for C++ programmers who want to understand the semantic implications of the C++ object model and how the model affects their programs.

Author Biography

Stanley Lippman is currently principal software engineer at Walt Disney Feature Animation.

Table of Contents

Object Lessons
Layout Costs for Adding Encapsulation
The C++ Object Model
A Keyword Distinction
An Object Distinction
The Semantics of Constructors
Default Constructor Construction
Copy Constructor Construction
Program Transformation Semantics
Member Initialization List
The Semantics of Data
The Binding of a Data Member
Data Member Layout
Access of a Data Member
Inheritance and the Data Member
Object Member Efficiency
Pointer to Data Members
The Semantics of Function
Varieties of Member Invocation
Virtual Member Functions
Function Efficiency
Pointer-to-Member Functions
Inline Functions
Semantics of Construction, Destruction, and Copy
Object Construction without Inheritance
Object Construction under Inheritance
Object Copy Semantics
Object Efficiency
Semantics of Destruction
Runtime Semantics
Object Construction and Destruction
Operators new and delete
Temporary Objects
On the Cusp of the Object Model
Exception Handling
Runtime Type Identification
Efficient, but Inflexible
Table of Contents provided by Publisher. All Rights Reserved.

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.


For nearly a decade within Bell Laboratories, I labored at implementing C++. First it was on cfront, Bjarne Stroustrup's original C++ implementation (from Release 1.1 back in 1986 through Release 3.0, made available in September 1991). Then it was on what became known internally as the Simplifier, the C++ Object Model component of the Foundation project. It was during the Simplifier's design period that I conceived of and began working on this book.What was the Foundation project? Under Bjarne's leadership, a small group of us within Bell Laboratories was exploring solutions to the problems of large-scale programming using C++. The Foundation was an effort to define a new development model for the construction of large systems (again, using C++ only; we weren't providing a multilingual solution). It was an exciting project, both for the work we were doing and for the people doing the work: Bjarne, Andy Koenig, Rob Murray, Martin Carroll, Judy Ward, Steve Buroff, Peter Juhl, and myself. Barbara Moo was supervising the gang of us other than Bjarne and Andy. Barbara used to say that managing a software group was like herding a pride of cats.We thought of the Foundation as a kernel upon which others would layer an actual development environment for users, tailoring it to a UNIX or Smalltalk model as desired. Internally, we called it Grail, as in the quest for, etc. (It seems a Bell Laboratories tradition to mock one's most serious intentions.)Grail provided for a persistent, semantic-based representation of the program using an object-oriented hierarchy Rob Murray developed and named ALF. Within Grail, the traditional compiler was factored into separate executables. The parser built up the ALF representation. Each of the other components (type checking, simplification, and code generation) and any tools, such as a browser, operated on (and possibly augmented) a centrally stored ALF representation of the program. The Simplifier is the part of the compiler between type checking and code generation. (Bjarne came up with the name Simplifier; it is a phase of the original cfront implementation.)What does a Simplifier do between type checking and code generation? It transforms the internal program representation. There are three general flavors of transformations required by any object model component: Implementation-dependent transformations. These are implementation-specific aspects and vary across compilers. Under ALF, they involved the transformations of what we called "tentative" nodes. For example, when the parser sees the expression fct(); it doesn't know if this is (a) an invocation of a function represented or pointed to by fct or (b) the application of an overloaded call operator on a class object fct. By default, the expression is represented as a function call. The Simplifier rewrites and replaces the call subtree when case (b) applies. Language semantics transformations. These include constructor/destructor synthesis and augmentation, memberwise initialization and memberwise copy support, and the insertion within program code of conversion operators, temporaries, and constructor/destructor calls. Code and object model transformations. These include support for virtual functions, virtual base classes and inheritance in general, operators new and delete, arrays of class objects, local static class instances, and the static initialization of global objects with nonconstant expressions. An implementation goal I aimed for in the Simplifier was to provide an Object Model hierarchy in which the object implementation was a virtual interface supporting multiple object models.These last two categories of transformations form the basis of this book. Does this mean this book is written for compiler writers? No, absolutely not. It is written by a (former) compiler writer (that's me) for intermediate to advanced C++ programmer

Rewards Program