Computer Science, asked by Karthiabc3306, 1 year ago

How the class template is differ from function template?

Answers

Answered by Raju2392
0

Answer:

For normal code, you would use a class template when you want to create a class that is parameterised by a type, and a function template when you want to create a function that can operate on many different types. ... Expression templates allow you to speed up certain types of code or create domain specific languages.

Answered by Anonymous
0

 \bf \underline{ \pink{Answer}} :-    \huge\dag

For normal code, you would use a class template when you want to create a class that is parameterised by a type, and a function template when you want to create a function that can operate on many different types.

Function templates are also able to do type-deduction, which can be useful for creating factory functions:

Similar questions