草庐IT

VectorImpl

全部标签

c++ - 混合部分模板特化和默认模板参数

我想创建一个通用vector类并为一些情况创建特化。像这样的东西(它不编译,但希望传达我的意图):templateclassVector{public:typedefVectorVecType;Vector(){/**/}Vector(constVecType&other){/**/)Vector&operator=(constVecType&other){/**/}VecTypeoperator+(constVecType&other){/**/}VecTypeoperator-(constVecType&other){/**/}Toperator*(constVecType&oth