1.

What is the syntax to use explicit class specialization?(a) template class myClass{}(b) template class myClass{}(c) template class myClass{}(d) template class myClass{}The question was posed to me by my college director while I was bunking the class.My query is from Template Class in portion Classes of Object Oriented Programming

Answer» RIGHT CHOICE is (d) template <> CLASS myClass{}

Explanation: The class specialization is creation of EXPLICIT specialization of a generic class. We have to use template<> constructor for this to work. It works in the same WAY as with explicit function specialization.


Discussion

No Comment Found

Related InterviewSolutions