Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/algorithm/reverse copy"

From cppreference.com
< cpp‎ | algorithm
m (Text replace - "{{example}}" to "===Example===")
m (Text replace - "<!-- ======== --> " to "")
Line 11: Line 11:
 
Copies the elements from the range {{tt|[first, last)}}, to another range beginning at {{tt|d_first}} in such a way, that the elements in the new range are in reverse order.  
 
Copies the elements from the range {{tt|[first, last)}}, to another range beginning at {{tt|d_first}} in such a way, that the elements in the new range are in reverse order.  
  
<!-- ======== -->
 
 
===Parameters===
 
===Parameters===
 
{{param list begin}}
 
{{param list begin}}
Line 18: Line 17:
 
{{param list end}}
 
{{param list end}}
  
<!-- ======== -->
 
 
===Return value===
 
===Return value===
  
 
output iterator to the element past the last element copied.
 
output iterator to the element past the last element copied.
  
<!-- ======== -->
 
 
===Equivalent function===
 
===Equivalent function===
 
{{eq fun cpp | 1=
 
{{eq fun cpp | 1=
Line 29: Line 26:
 
}}
 
}}
  
<!-- ======== -->
 
 
===Example===
 
===Example===
 
{{example cpp
 
{{example cpp
Line 39: Line 35:
 
}}
 
}}
  
<!-- ======== -->
 
 
===Complexity===
 
===Complexity===
  
 
linear in the distance between {{tt|first}} and {{tt|last}}
 
linear in the distance between {{tt|first}} and {{tt|last}}
  
<!-- ======== -->
 
 
===See also===
 
===See also===
 
{{dcl list begin}}
 
{{dcl list begin}}
 
{{dcl list template | cpp/algorithm/dcl list reverse}}
 
{{dcl list template | cpp/algorithm/dcl list reverse}}
 
{{dcl list end}}
 
{{dcl list end}}

Revision as of 18:01, 2 August 2011

Template:cpp/algorithm/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <algorithm>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td class="t-dcl-nopad">
template< class BidirectionalIterator, class OutputIterator >
OutputIterator reverse_copy( BidirectionalIterator first, BidirectionalIterator last, OutputIterator d_first );
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

Copies the elements from the range [first, last), to another range beginning at d_first in such a way, that the elements in the new range are in reverse order.

Contents

Parameters

first, last - the range of elements to copy
d_first - the beginning of the destination range

Return value

output iterator to the element past the last element copied.

Equivalent function

Template:eq fun cpp

Example

Template:example cpp

Complexity

linear in the distance between first and last

See also

Template:cpp/algorithm/dcl list reverse