Code speaks:
template<typename Group>
struct Vector3D {
Group x, y, z;
Vector3D(Group x, Group y, Group z) : x(x), y(y), z(z) {
}
template<int p> Group Norm() const;
};
template<typename Group> template<int p>
Group Vector3D<Group>::Norm() const {
return pow( pow(x, p) + pow(y, p) + pow(z, p), (1.0 / p) );
}
/*
template<typename Group> template<>
Group Vector3D<Group>::Norm<2>() const {
return sqrt( x * x + y * y + z * z );
}*/
The commented block fails to compile in vc11(vs2012)
Could anyone help to point out what is the right way to partial specialize the Norm function?