草庐IT

ByeKeyAndValue

全部标签

c++ - 专门用于枚举的模板

谁能告诉我为什么这不起作用?enumCompCriteria{ByKey,ByValue,ByeKeyAndValue};templatestructX;templatestructX{};int_tmain(intargc,_TCHAR*argv[]){Xx;return0;} 最佳答案 您将参数化类型和参数化值混为一谈。模板参数可以是类型或常量。例如:templatestructFoo;相对于..templatestructFoo;看起来您想根据枚举常量而非类型来专门化您的模板。意思是,你需要说:enumCompCriteria