C++ STL advance 和next 区别
Posted malcolmmeng
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C++ STL advance 和next 区别相关的知识,希望对你有一定的参考价值。
std::advance
- modifies its argument
- returns nothing
- works on input iterators or better (or bi-directional iterators if a negative distance is given)
std::next
- leaves its argument unmodified
- returns a copy of the argument, advanced by the specified amount
- works on forward iterators or better (or bi-directional iterators if a negative distance is given))
https://stackoverflow.com/questions/15017065/whats-the-difference-between-stdadvance-and-stdnext
以上是关于C++ STL advance 和next 区别的主要内容,如果未能解决你的问题,请参考以下文章
C++ STL应用与实现62: 如何使用std::next_permutation