mapXXX.insert(std::pair<string, std::vector<int>>('hello', xxx));
总是报 cannot appear in a constant-expression 的错误。
其实在最下面还有个错误 ‘>>’ should be '> >' within a nested template argument list
最后面这个指出了错误个根源,
即嵌套的模板中,最后面的两个尖括号不能挨着写。。。。。。
本文探讨了在C++编程中使用标准模板库(map)时出现的语法错误,特别是关于如何正确书写嵌套模板参数的问题。
mapXXX.insert(std::pair<string, std::vector<int>>('hello', xxx));
总是报 cannot appear in a constant-expression 的错误。
其实在最下面还有个错误 ‘>>’ should be '> >' within a nested template argument list
最后面这个指出了错误个根源,
即嵌套的模板中,最后面的两个尖括号不能挨着写。。。。。。
1316

被折叠的 条评论
为什么被折叠?