1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>rotate_copy</title> 5<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../../../index.html" title="Chapter 1. Range 2.0"> 8<link rel="up" href="../mutating.html" title="Mutating algorithms"> 9<link rel="prev" href="rotate.html" title="rotate"> 10<link rel="next" href="sort.html" title="sort"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="rotate.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../mutating.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="sort.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h5 class="title"> 27<a name="range.reference.algorithms.mutating.rotate_copy"></a><a class="link" href="rotate_copy.html" title="rotate_copy">rotate_copy</a> 28</h5></div></div></div> 29<h6> 30<a name="range.reference.algorithms.mutating.rotate_copy.h0"></a> 31 <span class="phrase"><a name="range.reference.algorithms.mutating.rotate_copy.prototype"></a></span><a class="link" href="rotate_copy.html#range.reference.algorithms.mutating.rotate_copy.prototype">Prototype</a> 32 </h6> 33<p> 34</p> 35<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">ForwardRange</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">OutputIterator</span><span class="special">></span> 36<span class="identifier">OutputIterator</span> <span class="identifier">rotate_copy</span><span class="special">(</span> 37 <span class="keyword">const</span> <span class="identifier">ForwardRange</span><span class="special">&</span> <span class="identifier">rng</span><span class="special">,</span> 38 <span class="keyword">typename</span> <span class="identifier">range_iterator</span><span class="special"><</span><span class="identifier">ForwardRange</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">middle</span><span class="special">,</span> 39 <span class="identifier">OutputIterator</span> <span class="identifier">out</span><span class="special">);</span> 40</pre> 41<p> 42 </p> 43<h6> 44<a name="range.reference.algorithms.mutating.rotate_copy.h1"></a> 45 <span class="phrase"><a name="range.reference.algorithms.mutating.rotate_copy.description"></a></span><a class="link" href="rotate_copy.html#range.reference.algorithms.mutating.rotate_copy.description">Description</a> 46 </h6> 47<p> 48 <code class="computeroutput"><span class="identifier">rotate_copy</span></code> rotates the 49 elements in a range. It copies the two ranges <code class="computeroutput"><span class="special">[</span><span class="identifier">begin</span><span class="special">(</span><span class="identifier">rng</span><span class="special">),</span> <span class="identifier">middle</span><span class="special">)</span></code> 50 and <code class="computeroutput"><span class="special">[</span><span class="identifier">middle</span><span class="special">,</span> <span class="identifier">end</span><span class="special">(</span><span class="identifier">rng</span><span class="special">))</span></code> to <code class="computeroutput"><span class="identifier">out</span></code>. 51 </p> 52<h6> 53<a name="range.reference.algorithms.mutating.rotate_copy.h2"></a> 54 <span class="phrase"><a name="range.reference.algorithms.mutating.rotate_copy.definition"></a></span><a class="link" href="rotate_copy.html#range.reference.algorithms.mutating.rotate_copy.definition">Definition</a> 55 </h6> 56<p> 57 Defined in the header file <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">range</span><span class="special">/</span><span class="identifier">algorithm</span><span class="special">/</span><span class="identifier">rotate_copy</span><span class="special">.</span><span class="identifier">hpp</span></code> 58 </p> 59<h6> 60<a name="range.reference.algorithms.mutating.rotate_copy.h3"></a> 61 <span class="phrase"><a name="range.reference.algorithms.mutating.rotate_copy.requirements"></a></span><a class="link" href="rotate_copy.html#range.reference.algorithms.mutating.rotate_copy.requirements">Requirements</a> 62 </h6> 63<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 64<li class="listitem"> 65 <code class="computeroutput"><span class="identifier">ForwardRange</span></code> is a 66 model of the <a class="link" href="../../../concepts/forward_range.html" title="Forward Range">Forward 67 Range</a> Concept. 68 </li> 69<li class="listitem"> 70 <code class="computeroutput"><span class="identifier">ForwardRange</span></code> is mutable. 71 </li> 72<li class="listitem"> 73 <code class="computeroutput"><span class="identifier">OutputIterator</span></code> is 74 a model of the <code class="computeroutput"><span class="identifier">OutputIteratorConcept</span></code>. 75 </li> 76</ul></div> 77<h6> 78<a name="range.reference.algorithms.mutating.rotate_copy.h4"></a> 79 <span class="phrase"><a name="range.reference.algorithms.mutating.rotate_copy.precondition_"></a></span><a class="link" href="rotate_copy.html#range.reference.algorithms.mutating.rotate_copy.precondition_">Precondition:</a> 80 </h6> 81<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 82<li class="listitem"> 83 <code class="computeroutput"><span class="special">[</span><span class="identifier">begin</span><span class="special">(</span><span class="identifier">rng</span><span class="special">),</span> <span class="identifier">middle</span><span class="special">)</span></code> is a valid range. 84 </li> 85<li class="listitem"> 86 <code class="computeroutput"><span class="special">[</span><span class="identifier">middle</span><span class="special">,</span> <span class="identifier">end</span><span class="special">(</span><span class="identifier">rng</span><span class="special">))</span></code> is a valid range. 87 </li> 88</ul></div> 89<h6> 90<a name="range.reference.algorithms.mutating.rotate_copy.h5"></a> 91 <span class="phrase"><a name="range.reference.algorithms.mutating.rotate_copy.complexity"></a></span><a class="link" href="rotate_copy.html#range.reference.algorithms.mutating.rotate_copy.complexity">Complexity</a> 92 </h6> 93<p> 94 Linear. Exactly <code class="computeroutput"><span class="identifier">distance</span><span class="special">(</span><span class="identifier">rng</span><span class="special">)</span></code> elements are copied. 95 </p> 96</div> 97<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 98<td align="left"></td> 99<td align="right"><div class="copyright-footer">Copyright © 2003-2010 Thorsten Ottosen, 100 Neil Groves<p> 101 Distributed under the Boost Software License, Version 1.0. (See accompanying 102 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 103 </p> 104</div></td> 105</tr></table> 106<hr> 107<div class="spirit-nav"> 108<a accesskey="p" href="rotate.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../mutating.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="sort.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 109</div> 110</body> 111</html> 112