码迷,mamicode.com
首页 > 编程语言 > 详细

C++ STL advance 和next 区别

时间:2019-05-05 20:36:34      阅读:465      评论:0      收藏:0      [点我收藏+]

标签:tac   between   modified   inpu   class   and   hat   ref   enc   

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 区别

标签:tac   between   modified   inpu   class   and   hat   ref   enc   

原文地址:https://www.cnblogs.com/MalcolmMeng/p/10816036.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!