Partially specializing member-function implementations

前端 未结 4 694
温柔的废话
温柔的废话 2021-01-20 04:58

I\'m currently refactoring some code the explicitly specializes a member function of a class template with two template parameters.

template 

        
4条回答
  •  走了就别回头了
    2021-01-20 05:24

    You are correct, it is not possible.

    What you can do is create a helper member class template inside the new Foo, and place the specialized function inside it as a non-template member function. Specialize the helper class instead of the function.

    Another alternative is to turn the specialization into a non-template overload.

提交回复
热议问题