MathWorks interview question

Template class (c++)