Templates - class friend templated function

Use case:
We have templated external methods that transform/process/compute_from classes/containers (vec3, mat4x4, aabox, etc) and want them to be able to accesss the object members (total coupling...not ideal)

template<typename T> struct classA;
template<typename T, typename Policy = void> bool func(T& a);
template<typename T, typename Policy> bool func(T& a)
{
static_assert(std::is_fundamental<T>::value, "");
std::cerr<<"its func(T)"<<std::endl;
return false;
}
template<typename T, typename Policy = void> bool func(classA<T>& a);
template<typename T>
struct classA
{
protected:
int m;
//template<typename T2, typename Policy2> friend bool func(classA<T2>& a);
friend bool func<T>(classA<T>& a);
};
template<typename T, typename Policy> bool func(classA<T>& a)
{
std::cerr<<"its func(classA<T>)"<<std::endl;
return a.m;
}
int main()
{
classA<int> a;
bool r = func(a);
}