Power of template in C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Power of template in C++

I want to know whether it is possible to do generic programming in C++ without using templates. Is it possible to write all libraries available in C++ which are written using templates without using templates. Is there any alternative available in C++ for templates?

4th Dec 2016, 8:48 AM
Zarbab
3 Answers
+ 1
Yes, you can do it but it would be very time-consuming and I'd say even useless. Why not taking advantage of templates? ;-)
8th Jan 2017, 11:48 AM
Diego
Diego - avatar
0
sure you can code every permutation. but then you have a lot of code that is not needed. so yes you can but why would you?
4th Dec 2016, 4:37 PM
Drauchris
Drauchris - avatar
0
It would be very hard because unlike some other languages like java, there is no common ancestor class (like Object) that you can use.
27th Dec 2016, 10:02 AM
ifl
ifl - avatar