Lesson 22 of 24
Templates: Generic Code
9 min 35 XP
A template lets one function or class work with any type. vector<int> and vector<string> are templates themselves!
Example: edit me and press Run
Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.