How to overload a template class for a particular user defined data type? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How to overload a template class for a particular user defined data type?

I have a Matrix Class defined with a template for various data types... Now I want to use the complex class of c++0x in it as well... But, now, the functions of complex data type must vary from those of normal data types like int, double, etc... So, how can I overload the matrix class to get this ability? How can I store a complex value in a matrix array and call the new constructor without invoking the original one? Please suggest me a possible solution...

30th Mar 2017, 4:48 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
1 Answer
+ 4
Can this be done, or a new seperate class must be defined?
30th Mar 2017, 12:14 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar