Generic Programming

what is the difference between template < typename T > and template < class T > ??? if both are same then what is the use of other one??

Please refer to this thread What is the difference between typename & class? . If you still have further doubts, read this https://www.programmersought.com/article/91411130642/

1 Like

Ohh ok so typename can’t be used with nested templates.
Thanks alot @sdevwrat!!!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

1 Like