The choice between typename and class

When working with C++ templates, you have probably seen typename and class used interchangeably. Is there a difference between them? This post will explain when these two keywords can be used in templates. Let’s consider the following example: In this context, when declaring a type template parameter, there is no difference, they are interchangeable. They…