std :: advance和std :: next有什么区别? [英] What's the difference between std::advance and std::next?

查看:213
本文介绍了std :: advance和std :: next有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有更多的超前提取负数?

Is there more beyond advance takes negative numbers?

推荐答案

std :: advance


  • 修改其参数

  • 不返回任何内容

  • 适用于输入迭代器或更好(如果给定负距离,则为双向迭代器)

std :: next


  • 保留其参数未修改

  • 返回参数的副本,按指定的量前进

  • 在向前迭代器或更好的迭代器上工作(如果给定负距离,则为双向迭代器) li>
  • 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))

这篇关于std :: advance和std :: next有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆