Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 471 Bytes

File metadata and controls

16 lines (12 loc) · 471 Bytes

Compile-time Polymorphism

What it is

Polymorphic behavior resolved by compiler before program runs.

Common Ways

  • Function overloading
  • Operator overloading
  • Templates

Example in this folder

  • Printer::print(...) demonstrates overloading
  • add<T>(...) demonstrates template-based polymorphism

Interview Quick Line

"Compile-time polymorphism gives fast, type-safe behavior selection using overloads and templates without runtime virtual dispatch."