Where Does the this Pointer REALLY Point in C++? (It’s Not the Object)
Автор: CodeBing
Загружено: 2026-01-10
Просмотров: 94
Most C++ developers believe that the this pointer always points to the object’s address.
That belief is technically wrong — and in real-world C++ code, it can lead straight to undefined behavior.
In this video, we take a deep dive into what the `this` pointer REALLY is in C++.
You’ll learn:
Why `this` is NOT guaranteed to point to the start of an object
How multiple inheritance breaks the “this == object address” illusion
How compilers adjust the `this` pointer behind the scenes
Why virtual functions in multiple inheritance require thunks
How ABI rules, not the C++ language itself, define object layout
We’ll walk through real memory layouts, compiler behavior, and virtual dispatch paths used by GCC and Clang.
If you’ve ever:
cast `this` with `reinterpret_cast`
assumed `this` points to the most-derived object
relied on object memory layouts
serialized objects via raw memory dumps
crossed ABI boundaries between modules
…then this video explains exactly why that’s dangerous.
Once you understand that C++ member functions are just functions with a hidden parameter,
many “mysterious” behaviors suddenly make perfect sense.
In the next video, we’ll push this idea further and explain why
the real boundary of C++ is the ABI, not the language itself.
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: