The layout of C++ Object Model

S

skydrive

Hi, I've just bought a copy of "Inside the C++ Object" book by
Stanley B. Lippman. One thing that I want to know is that, is the C++
Object Model implementation-defined by C++ Complier ? I haven't read C+
+ Standard mention a word about how the layout of model will be in the
memory.

Thanks.
Dave
 
V

Victor Bazarov

Hi, I've just bought a copy of "Inside the C++ Object" book by
Stanley B. Lippman. One thing that I want to know is that, is the C++
Object Model implementation-defined by C++ Complier ? I haven't read C+
+ Standard mention a word about how the layout of model will be in the
memory.

Not sure what you mean by "implementation-defined by C++ Compiler".
Usually the behaviour that is "implementation defined", has to be
documented by the implementation (the Standard requires that). Object
layouts don't have to be documented. They are implementation-specific,
no doubt about that, but not "defined" in the "published" sense.

V
 
C

Christopher

What does your book claim a "C++ Object Model" is anyway?
Looks like a made up term to me.

If we are talking about what Amazon wrote out the book:

* differences between C++ structures and classes
* default and copy constructors
* data members
* initialization
* inheritance, including virtual inheritance
* templates
* exception handling
* run-time type information

Then these things are surely defined by the standard.
 
A

Alf P. Steinbach

Hi, I've just bought a copy of "Inside the C++ Object" book by
Stanley B. Lippman. One thing that I want to know is that, is the C++
Object Model implementation-defined by C++ Complier ? I haven't read C+
+ Standard mention a word about how the layout of model will be in the
memory.

Things like memory layouts are constrained by the standard, but not
fully specified.

And in particular, I believe Stanley is talking a good deal about vtable
pointers and vtables, which is how in practice all C++ compilers
implement virtual member functions (small variations between compilers).

The standard does however not require that virtual member functions are
implemented that way.

Cheers & hth.,

- Alf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,526
Members
44,997
Latest member
mileyka

Latest Threads

Top