Skip to main content

3 docs tagged with "generic-programming"

View all tags

Class Templates

Class templates create generic classes that work with different types. Think std::unique_ptr - same class, different types.

Function Templates

Function templates let you write one function that works with different types. The compiler generates specific versions for each type you use.

Policy-Based Design

Policy-based design decomposes complex behaviors into independent policy classes combined through templates. Each policy defines one aspect of behavior, and policies are mixed together to create flexible, reusable components.