Why does the C++ standard not allow function template partial specialization?

一笑奈何 提交于 2019-12-10 17:21:06

问题


And before you downvote, yes I could have read the whole book from Stroustrup where it's maybe written somewhere in a side not. But maybe someone else asked themselves the same question and found a good answer. At least to me it seems like this would be handy to have.

I read something that it might be confusing for the compiler to write

template <class T>
void calculator<std::complex<T>>::myMin();

but maybe just give it a hint like so? To make it clear that it is a partial specialization.

template < , class T>
void calculator<std::complex<T>>::myMin();

来源:https://stackoverflow.com/questions/40652694/why-does-the-c-standard-not-allow-function-template-partial-specialization

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!