We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
大神,刚看了9.22的代码和相关问题的讨论,学习到了很多东西,现在我有一个疑问: ++cursor; mid = iv.begin() + cursor; 这两句中如果++cursor,那第二句的mid是不是会随着向后移动一位,如果是的话我的理解是每次循环mid都向后移动一位那while循环会历遍iv,结果应该是每个等于给定值的元素前都会添加一个*2的新元素。可是编译结果确实是在中间位置以后就没有再插入元素了。我想不太明白其中的道理,希望能解答一下。 ps:我试着删除了++cursor,发现编译结果没有改变,意味着什么?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
大神,刚看了9.22的代码和相关问题的讨论,学习到了很多东西,现在我有一个疑问:
++cursor;
mid = iv.begin() + cursor;
这两句中如果++cursor,那第二句的mid是不是会随着向后移动一位,如果是的话我的理解是每次循环mid都向后移动一位那while循环会历遍iv,结果应该是每个等于给定值的元素前都会添加一个*2的新元素。可是编译结果确实是在中间位置以后就没有再插入元素了。我想不太明白其中的道理,希望能解答一下。
ps:我试着删除了++cursor,发现编译结果没有改变,意味着什么?
The text was updated successfully, but these errors were encountered: