Generic Programming


Generic programming allows components which are extensively customizable, yet retain the efficiency of statically configured code. This technique can eliminate dependencies between types and algorithms that are conceptually not necessary.

Generic programming, like object-oriented programming (OOP), relies on a form of polymorphism. The polymorphism in OOP applies at run time to classes related by inheritance.
Generic programming lets us write classes and functions that are polymorphic across unrelated types at compile time.

In C++, templates are the foundation for generic programming.

See Also

Generative Programming

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.