1.

Which parameter is legal for non-type template?(a) pointer to member(b) object(c) class(d) baseclassThe question was posed to me in a job interview.My question is taken from Template Arguments to Specify Policy Usage topic in division Derived Classes, Templates & Exception Handling in C++ of C++

Answer» RIGHT ANSWER is (a) pointer to MEMBER

Explanation: The following are legal for non-type template parameters:integral or enumeration type, Pointer to OBJECT or pointer to function, Reference to object or reference to function, Pointer to member.


Discussion

No Comment Found

Related InterviewSolutions