Template (C++)

A template lets you write a function or class that works with any type, with the actual type filled in when you use it. This is how C++ supports generic…