My template class method returns bad type ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

My template class method returns bad type ?

The template class method "return_self" must return a object of type Class<string> . But, it returns Class<basic_string<char>> . Why, please check out my code https://code.sololearn.com/cWVYRFpN37K4/?ref=app

30th Jun 2020, 4:38 AM
Terminal_Phantom
Terminal_Phantom - avatar
1 Answer
+ 1
you can pass the Class<Type> argument by const reference,to the operator<< function
30th Jun 2020, 9:05 AM
Anthony Maina
Anthony Maina - avatar