我正在尝试对模板运算符进行专门化,模板看起来像这样:
template <typename Iterator1, typename Iterator2>
ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const
Run Code Online (Sandbox Code Playgroud)
在我完成了这样的专业化之后:
template <>
float operator()<float*,float*>(float* a, float const* b, unsigned long size, float worst_dist = -1) const
Run Code Online (Sandbox Code Playgroud)
我在编译期间遇到错误:
无法在类范围内专门化一个函数'operator()'
所有这些功能都在struct模板中
我很乐意得到一些帮助.谢谢.