我在 StackOverflow 和 Google 上搜索了很多主题,但我不明白我做错了什么。
template<class T>
class E {
T data;
};
int main() {
vector<E> vector1;
return 0;
}
它返回构建错误:
error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector'
vector<E> vector1;
知道了。
int main() {
vector<E<int>> vector1;
return 0;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句