peter koch wrote:
al*****@gmail.com skrev:
Which sections of the 2003 standard should I study to understand the
object model? I am looking to find information similar to that in
Stanley B. Lippman's book, "Inside the C++ Object Model"
If I understand you correctly, no part of the standard will be
relevant. The standard mandates almost nothing w.r.t. the physical
layout of objects (the most important exception being that a
std::vector must be implemented as one contigeous chunk of memory).
One thing that could tell you about a possible implementation of C++ is
the C++ performance report. Google for it.
/Peter
I recently had an interview for a C++ programmer position and the
interviewer asked me questions like:
where does the virtual table reside? (my answer: in memory)
why don't we make all destructors virtual? (my answer: because they
will cost memory due to vtable and some classes are not designed to be
base classes)
If we add a virtual function to a class will we see an increase in
class size? (i said yes)
While size of class grow at constant rate with the addition of each
virtual function? (i said not sure)
He then paused and gave me some advice on which books to read, saying
that I must read "Inside the C++ Object Model". He also said that I
can't be a good C++ programmer without being a good C programmer. It is
disappointing because I answered each question to the best of my
ability. There were some algorithm problems as well but he criticized
me most for knowledge of C++. So essentially there is no set standard
for how objects should be represented internally?