Can someone please explain me why is this not compiling...the specialized function of a specialized class ??? In the specialized version of the templated class the specialized function is not compiling.
#include<iostream>
using namespace std;
//Default template class
template<typename T>
class X
{
public:
void func(T t) const;
};
template<typename T>
void X<T>::func(T b) const
{
cout << endl << "Default Version" << endl;
}
//Specialized version
template<>
class X<int>
{
public:
void func(int y) const;
};
template<>
void X<int>::func(int y)
{
cout << endl << "Int Version" << endl;
}
int main()
{
return 0;
}