9 ( 10%) Indicate whether h statment is truc or false a. Can function templates
ID: 3907095 • Letter: 9
Question
9 ( 10%) Indicate whether h statment is truc or false a. Can function templates be ovcrloaded wih oher semglate or -semplate b Can function templates harve more than one type parameters designed by the class keyword followed by type names Can class templates be derived from bodh non-emplate and semplate classes and can have both.gop-semplate and semplate classes derived from them d. Can class template the nested within other classes just like ondinary classes e. Can class templates have non-ype or only non-ope parameners?Explanation / Answer
a)Can function templates be overloaded with other non template or template functions
- TRUE
The example below describes the statement :
Then the output we get is :
b) Can function template have more tha one type parameters designed by the class keyword followed by type names ?
-TRUE
The function template have more tha one type parameters designed by the class keyword followed by type names , for example see the declarartion :
c) Can class template be derived from both template and non template classes and can have both non template and template classes derived from the ?
-TRUE
Template class can be derived from both template and non template classes and can have multiple inheritance , and a non template class can be derived from template class , A non-template derived class can inherit from a template base class if the template's parameter is fixed .
d) Can class template be nested within other classes just like ordinary classes ?
-TRUE
Class template be nested within other classes just like ordinary classes , the member templates are the nested classes , and are declared inside the scope of the outer class.
e) Can class templates have non type or only non type parameters?
-TRUE
They are usually used to initialize class.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.