Skip to content

Commit f75dd22

Browse files
committed
add article
1 parent 75e2970 commit f75dd22

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

virtual/Polymorphism.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,3 +414,5 @@ Base Destructor
414414
3. `Creation of vTable by Compiler:` when a class contains virtual functions, the compiler creates a vTable(virtual function table) for that class. this table contains pointers to virtual functions of the class.
415415
4. `Pointer Adjustment:` Each object of the class that contains virtual functions includes a hidden pointer(known as vPtr) that points to the vTable. This pointer is initialized by the constructor of the class and adjusted during inheritance.
416416
5. `Dynamic Dispatcher:` when you call a virtual function on a base class pointer or reference, the actual function that gets executed is determined at runtime based on the type of the object the pointer or reference pointing to. this is known as dynamic dispatch.
417+
418+
Article: [Vtable and vPtr](https://pabloariasal.github.io/2017/06/10/understanding-virtual-tables/)

0 commit comments

Comments
 (0)