无法使用模板编译 std::list 迭代器
当我尝试编译它时,出现此错误:
error: expected `;' before 'it'
为什么我无法声明此迭代器?问题出在哪里?
#include <list>
template <typename Z>
class LBFuncBase: public LBBaseBlock<Z>
{
void Something() {
std::list<LBBaseBlock< Z >* >::iterator it;
}
};
When I try to compile this I get this error:
error: expected `;' before 'it'
Why I can't declare this iterator? Where is the problem?
#include <list>
template <typename Z>
class LBFuncBase: public LBBaseBlock<Z>
{
void Something() {
std::list<LBBaseBlock< Z >* >::iterator it;
}
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试:
编辑:
参见“为什么有时需要写 typename" 以获得解释。
Try:
Edit:
See "Why do you sometimes need to write typename" for an explanation.