Introduction To Templates

Learn about function templates and how we can use them 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.

Continue your learning journey with a 14-day free trial.

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