Page 1 of 1

What type can be used to replace templates from this function?

Posted: Wed Jul 13, 2022 7:52 pm
by answerhappygod
template<class T, class U>
T func(T a, T b, U c)
{
if(c == '+' || c){
return a+b;
}
else if(c == '-' || !c){
return a-b;
}
}
a) replace templates T, U with auto keyword
b) replace templates T, U with generic keyword
c) replace templates T, U with temp keyword
d) replace templates T, U with GEN_TEMP keyword