answersLogoWhite

0

Templates allow you to centralise code that only differs by type, but where the implementations are exactly the same. This reduces maintenance because all the code is one place and if modification is required, you only need to make the modification once, rather than once for each type which may lead to errors if you fail to propagate your changes. The compiler will generate the actual function overloads and class definitions for you, based upon the template and the types you actually use, rather than forcing you to write separate overloads and classes for types that might never be used.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions