Антон Asked:2023-06-06 03:15:09 +0000 UTC2023-06-06 03:15:09 +0000 UTC 2023-06-06 03:15:09 +0000 UTC 删除的模板函数 772 First写和写有区别吗Second? template<class T> void fun(T&& /*var*/) {} // First template<> void fun<int>(int&& var) = delete; // Second template<int> void fun(int&& var) = delete; c++ 1 个回答 Voted Best Answer user7860670 2023-06-06T03:21:58Z2023-06-06T03:21:58Z 第一个是上面针对 case 的模板特化fun<int>,第二个是类型调用的重载fun<4>。
第一个是上面针对 case 的模板特化
fun<int>,第二个是类型调用的重载fun<4>。