I am learning about C++ templates from C++ Primer 5th edition. For example, i learnt that we could do the following:
template<typename T>
struct Custom
{
};
template<>
struct Custom<int>
{
int a = 0;
};
Then i learnt that C++11 also added a feature of alias templates. So i tried the same with them as shown below:
template<typename T>
using var = std::stack<T>;
template<>
using var<double> = double;
But the above shown snippet doesn't work. What is the problem here, why doesn't the 2nd snippet work.