This is not possible in C ++. You can only specialize a member function template if you also specialize in all closing class templates.
But in any case, it is usually better to overload function templates rather than specializing in them (for details, see the article in the article by Herb Sutter ). So just do it:
template <typename T> class MyCLass { public: template <typename U> U myfunct(const U& x); double myfunct(double x); };
source share