partial specialization of function template

前端 未结 2 1691
挽巷
挽巷 2020-12-11 03:04

Can anybody explain why partial specialization is not valid for function template but it\'s fine for class template.

I understand partial specialization might make

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-11 03:37

    Now, I'm not an expert but I think the answer to the first part is that partial function specialisation would conflict (and be partially redundant) with function overloading. As for the second part, you can use a template struct that serves as a container for the thing you want to partially specialise.

提交回复
热议问题