C++ Explicit templated function instantiation for templated class of different type
问题 I am trying to explicitly instantiate a templated function of type U inside a templated class of type T. My code below generates a warning and the linker does not find the explicit instantiation of ReinterpretAs() . Can anyone spot the error or advise on how to do this? I am using VC++ 2010. template<typename T> class Matrix { public: template<typename U> Matrix<U> ReinterpretAs() const; }; template<typename T> template<typename U> Matrix<U> Matrix<T>::ReinterpretAs() const { Matrix<U> m; //