Friday, March 10, 2006

C++ object layout implementation

There are several cool implementation techniques of C++ object layout, especially when multiple inheritance, virtual functions and virtual inheritance is involved. Understanding the consequences of these rather advanced concepts in the language on the implementation of the language is quite interesting. There are several "gotchas" involved. Example, it is highly recommended to invoke the virtual base class's constructor in the derived most class when there is a diamond shape inheritance hierarchy. It is a pretty eloborate subject so I won't duplicate the same thing here. I would just assemble some really good articles on the topic. Lippman's book "Inside The C++ Object Model" talks about it at length.

Please see:

C++ Object layout in multiple inheritance
Adjustor thunks
Multiple inheritance in C++ (Stroustrup)


Anonymous said...

So what does "thunk" mean?
Why is this term used?

Sumant said...

Please see the following post.

marry said...

Blogs are so informative where we get lots of information on any topic. Nice job keep it up!!

Dissertation Editing