为什么默认模板参数只允许在类模板上?为什么我们不能在成员函数模板中定义默认类型?例如:
struct mycclass { template<class T=int> void mymember(T* vec) { // ... } };
相反,C++强制只允许在类模板上使用默认模板参数.
c++ templates
c++ ×1
templates ×1