Skip to main content

2 docs tagged with "virtual-functions"

View all tags

Dynamic vs Static Polymorphism

C++ supports two forms of polymorphism: dynamic (runtime, using virtual functions) and static (compile-time, using templates). Each has different trade-offs.

Virtual Functions and vtables

Virtual functions enable runtime polymorphism through dynamic dispatch. Understanding how they work (vtables) helps you understand their cost and use them effectively.