My Code is:
#include <iostream>
using namespace std;
template <typename T, int X>
class Test
{
private:
T container[X];
public:
void printSize();
};
template <typename T, int X>
void Test<T,X>::printSize()
{
cout <<"Container Size = "<<X <<endl;
}
int main()
{
cout << "Hello World!" << endl;
Test<int, 20> t;
Test<int, 30> t1;
t.printSize();
t1.printSize();
return 0;
}
Question:
- How many specialization will get generated?.
If I understand correctly , it generates two specializations one is for
<int, 20>
and another is for<int, 30>
. Kindly Correct if my understanding is wrong? - Is there any way to see/check the number of specializations generated by any reverse engineering?