template<>
class A<char> { // Error here
public:
A(char c)
{
// Do something here.
}
};
When I hover on A, it says "A is not a template".
template<>
class A<char> { // Error here
public:
A(char c)
{
// Do something here.
}
};
When I hover on A, it says "A is not a template".
You need to declare the template before you can specialize it:
// declare the template
template <typename T> // no need to define it
struct A; // if you only want the specialization
// declare and define the specialization
template<>
struct A<char> {};