~/talk

C++ Under the Hood: Internal Class Mechanisms

Talkat Core C++ 2026 · 2026-10-20..10-21· [c-and-cpp]
links:none on file
slides:none on file

Shows how polymorphism really maps to memory: compilers put a single vptr at offset 0 and one shared vtable per most-derived class, so virtual dispatch costs about one extra pointer per instance. Explains construction/destruction order precisely — inside-out construction, outside-in destruction — and why ctors and dtors write vptrs to ensure safe virtual calls. Demonstrates multiple-inheritance this-pointer adjustments, pointer-to-member data as offsets (null representation varies), global/static-init ordering, and concrete UB from calling methods on not-yet-constructed globals.

AI-written summary · about

  1. 0:00Introduction to C++ internals
  2. 1:54Object memory footprints
  3. 3:17Vtables and polymorphism
  4. 8:44Construction order in inheritance
  5. 10:56Inheritance and construction principles
  6. 13:25Constructor initialization lists
  7. 20:36Virtual functions and destructors
  8. 22:25Destruction order and vtable safety
  9. 28:29Global object construction
  10. 33:16Static variables in member functions
  11. 37:56Array construction and destruction
  12. 43:19Static memory destruction order
  13. 45:05State machines in global objects
  14. 47:40Pointers to functions in C++
  15. 50:11Pointers to member functions
  16. 52:42Pointer to member data
  17. 58:07Q&A and closing remarks
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.