Introduction To Templates

This lesson introduces the concept of function templates in C++

We'll cover the following

Definition

Templates are the mechanism by which C++ implements the generic concept.

The following example illustrates two non-generic (type-sensitive) functions for multiplying two numbers, x and y:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy