由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问个stl iterator的问题
相关主题
C++在vector里找>50的数,怎么找?面完G的电面了,忐忑
求教:这个程序为什么不能编译?包子求大牛:C++的list iterator实现
请教为什么这段程序运行不work?(doubly linked list) (转载请教个C++的基础问题
问一道C++ template的面试题问个stl的iterator问题
what is the internal implementation of Dequegoogle和iterator
问个题One C++ question
大家帮忙看看这个4sum怎么就不对const_reverse_iterator和reverse_iterator有什么区别?
ANY IDEA?请教c++的string vector问题,谢谢!
相关话题的讨论汇总
话题: iterator话题: vector话题: vit话题: stl话题: 问个
进入JobHunting版参与讨论
1 (共1页)
k***e
发帖数: 556
1
template
void testTemp(vector& v) {
vector::iterator vit;
vit = v.begin( );
}
如上所示,我想用定义一个iterator与参数T有关,再做些操作,
结果有错。哪位能指点一下!谢谢!
a**x
发帖数: 154
2
in this case the compiler has no idea about vector::iterator is a inner
class name or a static var in vector. so you need to use
typename vector::iterator vit;
to define a iterator
k***e
发帖数: 556
3
楼主强!

【在 a**x 的大作中提到】
: in this case the compiler has no idea about vector::iterator is a inner
: class name or a static var in vector. so you need to use
: typename vector::iterator vit;
: to define a iterator

g*******y
发帖数: 1930
4
楼主是你自己!呵呵

【在 k***e 的大作中提到】
: 楼主强!
k***e
发帖数: 556
5
晕 原来我一直理解错了楼主的含义
我以为我回的那个就是楼主
比如现在你就是

【在 g*******y 的大作中提到】
: 楼主是你自己!呵呵
l**a
发帖数: 43
6
嗯,effective STL 里面专门提到了typename的这个用途

【在 a**x 的大作中提到】
: in this case the compiler has no idea about vector::iterator is a inner
: class name or a static var in vector. so you need to use
: typename vector::iterator vit;
: to define a iterator

1 (共1页)
进入JobHunting版参与讨论
相关主题
请教c++的string vector问题,谢谢!what is the internal implementation of Deque
发面经,攒人品问个题
问个算法题,修改版大家帮忙看看这个4sum怎么就不对
请教一个排序的问题ANY IDEA?
C++在vector里找>50的数,怎么找?面完G的电面了,忐忑
求教:这个程序为什么不能编译?包子求大牛:C++的list iterator实现
请教为什么这段程序运行不work?(doubly linked list) (转载请教个C++的基础问题
问一道C++ template的面试题问个stl的iterator问题
相关话题的讨论汇总
话题: iterator话题: vector话题: vit话题: stl话题: 问个