~/talk

“Intro to the C++ Object Model"

Talkat CppCon 2015 · 2015-09-21..09-25· [c-and-cpp]
links:none on file
slides:none on file

Shows how objects map to memory: member functions become a hidden this parameter and are name‑mangled, and virtuals compile to a vtable pointer inserted as first member with a separate table of function pointers placed in read‑only text. Constructors initialize that pointer — constructor sets vptr — so virtual calls in constructors dispatch to the base type. Uses make, GCC/Clang and c++filt for examples; adding virtuals moves a 2‑float struct from 8 bytes to 16 and a million objects can cost ~8 MB.

AI-written summary · about

  1. 0:00Introduction to C++ object model
  2. 2:52Object-oriented programming basics
  3. 5:48C vs C++ struct memory layout
  4. 7:34Classes vs structs in C++
  5. 10:44Inheritance in C++ objects
  6. 12:28Member functions and this pointer
  7. 15:45Polymorphism with virtual functions
  8. 22:11Adding virtual functions to classes
  9. 24:03How vtables work in C++
  10. 28:01Constructors and vtable pointers
  11. 30:30Virtual functions in constructors
  12. 33:01Summary of C++ object model
  13. 33:24Q&A on virtual functions and vtables
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.