is that also what templates do in C++?
not really, with templates it allows an easy way of having multiple different instantiations of the same template with the same parameters result in the same type