I have this hpp
namespace A
{
template<class T>
class MyC
{
public:
T a;
};
template<class T>
void F(T r);
}
and this cpp
template<>
void A::F<double>(double r)
{
r;
}
template<>
void A::F<int>(int r)
{
r;
}
template<class T>
void A::F<A::MyC<T>>(A::MyC<T> r)
{
r;
}
template void A::F<A::MyC<int>>(A::MyC<int>);
template void A::F<A::MyC<double>>(A::MyC<double>);
but compiler says "unable to match function definition to an existing declaration" about F.
What's wrong with this code?