开发者

expression: deque iterator not incrementable (special case - i can't figure it out)

I have something like deq.push_back(object) which works fine in a source file but not in another one - if I try the same operation there I get the runtime error in the title. How can it be possible? deq is a global variable in the source file where the code works. Just as a test, I tried to swap the global declaration and the extern between the source files and I get the same result, the second source file triggers the ru开发者_运维技巧ntime error. What am I missing here? Why I can't use push_back from there?


Is it possible that you have moved the deq.push_back(object) statement to within a loop and thus modifying the container invalidates the loop iterator?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜