S
sumsin
The C++ Object Model book says that
'Nonstatic data members are allocated directly within each class
object. Static data members are stored outside the individual class
object. Static and nonstatic function members are also hoisted outside
the class object. Virtual functions are supported in two steps:
A table of pointers to virtual functions is generated for each class
(this is called the virtual table).
A single pointer to the associated virtual table is inserted within
each class object (traditionally, this has been called the vptr). The
setting, resetting, and not setting of the vptr is handled
automatically through code generated within each class constructor,
destructor, and copy assignment operator (this is discussed in Chapter
5). The type_info object associated with each class in support of
runtime type identification (RTTI) is also addressed within the
virtual table, usually within the table's first slot.'
Here I understand that one have some means to access:
- non-static data members and
- virtual function of the class object.
But then how one can access the other entities like:
- static data member
- static and non-static member functions?
How the above entities are represented with respect to class object
layout?
'Nonstatic data members are allocated directly within each class
object. Static data members are stored outside the individual class
object. Static and nonstatic function members are also hoisted outside
the class object. Virtual functions are supported in two steps:
A table of pointers to virtual functions is generated for each class
(this is called the virtual table).
A single pointer to the associated virtual table is inserted within
each class object (traditionally, this has been called the vptr). The
setting, resetting, and not setting of the vptr is handled
automatically through code generated within each class constructor,
destructor, and copy assignment operator (this is discussed in Chapter
5). The type_info object associated with each class in support of
runtime type identification (RTTI) is also addressed within the
virtual table, usually within the table's first slot.'
Here I understand that one have some means to access:
- non-static data members and
- virtual function of the class object.
But then how one can access the other entities like:
- static data member
- static and non-static member functions?
How the above entities are represented with respect to class object
layout?