由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - stl iterator in gdb
相关主题
一个C++的概念问题template question
c++ iterator 弱问[C++] 新手报错求助
c++ template question:请教c++的string vector问题,谢谢! (转载)
deque的pointer和reference是怎么回事?please help debug this code
how to write a function take iterators as parameters?Why C++11 introduce "decltype" and "auto"?
stl container erase in a loop问一个有关C++里面list的问题。
stl的一个问题这两个地方是否需要typename?
c++ pointers are iterators, why?怎么传container的单个地址吗?
相关话题的讨论汇总
话题: gdb话题: stl话题: std话题: current话题: find
进入Programming版参与讨论
1 (共1页)
g*********s
发帖数: 1782
1
I have some code using stl container and algorithm to debug. Below is what I get:
tag is a vector with size 3, the content is 0, 1, 2.
(gdb) p tag.begin()
$3 = {_M_current = 0x8053008}
(gdb) p tag.end()
$4 = {_M_current = 0x8053014}
(gdb) p tag.size()
$5 = 3
(gdb) p (tag.end() - tag.begin())
Attempt to take address of value not located in memory.
Why "3" is not properly output?
(gdb) p std::find(tag.begin(), tag.end(), 2)
No symbol "find" in namespace "std".
1 (共1页)
进入Programming版参与讨论
相关主题
怎么传container的单个地址吗?how to write a function take iterators as parameters?
C++ template Questions (转载)stl container erase in a loop
问一下STL里的queue, and stack 遍历的问题 (转载)stl的一个问题
function declarationc++ pointers are iterators, why?
一个C++的概念问题template question
c++ iterator 弱问[C++] 新手报错求助
c++ template question:请教c++的string vector问题,谢谢! (转载)
deque的pointer和reference是怎么回事?please help debug this code
相关话题的讨论汇总
话题: gdb话题: stl话题: std话题: current话题: find