zoukankan      html  css  js  c++  java
  • STL: rotate

    rotate

    Exchanges the elements in two adjacent ranges.

    template<class ForwardIterator> 
       void rotate( 
          ForwardIterator _First,  
          ForwardIterator _Middle,  
          ForwardIterator _Last 
       );

    rotate_copy

    Exchanges the elements in two adjacent ranges within a source range and copies the result to a destination range.

    template<class ForwardIterator, class OutputIterator> 
       OutputIterator rotate_copy( 
          ForwardIterator _First,  
          ForwardIterator _Middle, 
          ForwardIterator _Last,  
          OutputIterator _Result 
       );

    rotate和swap_ranges()功能颇为近似,但是swap_ranges只能交换两个长度相同的区间,rotate却可以交换两个长度不同的区间。所以如果两个区间的长度相同,则优先使用swap_ranges;而区间长度不同时,则使用rotate。

  • 相关阅读:
    hadoop2.2.0伪分布式搭建
    HBase详解
    Hbase常用命令
    hbase读取数据原理
    约瑟夫环
    哈希表设计
    哈夫曼树的建立
    TCP的连接和释放
    什么是Kmp算法?
    什么是https
  • 原文地址:https://www.cnblogs.com/freewater/p/2953637.html
Copyright © 2011-2022 走看看