std::move_backward
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <algorithm>
|
||
| template< class BidirIt1, class BidirIt2 > BidirIt2 move_backward( BidirIt1 first, BidirIt1 last, BidirIt2 d_last ); |
||
移动的范围内
[first, last)中的元素,在d_last到另一个范围的结局。以相反的顺序(最后一个元素是先移走)的元素被移动,但它们的相对顺序是保留的. Original:
Moves the elements from the range
[first, last), to another range ending at d_last. The elements are moved in reverse order (the last element is moved first), but their relative order is preserved. The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目录 |
[编辑] 参数
| first, last | - | 的范围内移动的元素
Original: the range of the elements to move The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| d_last | - | 年底的目标范围内。如果 d_last内[first, last),NJ的std ::移动</ span>必须使用代替std::move_backward. Original: end of the destination range. If d_last is within [first, last), NJ的std ::移动</ span> must be used instead of std::move_backward. </div>The text has been machine-translated via Google Translate. </div></div></div></div>
You can help to correct and verify the translation. Click here for instructions. |
| Type requirements | ||
-BidirIt1, BidirIt2 must meet the requirements of BidirectionalIterator.
| ||
[编辑] 返回值
目标范围的迭代器,指向最后一个元素的感动
Original:
Iterator in the destination range, pointing at the last element moved.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 复杂性
究竟
last - first移动作业.Original:
Exactly
last - first move assignments.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 可能的实现
template< class BidirIt1, class BidirIt2 > BidirIt2 move_backward(BidirIt1 first, BidirIt1 last, BidirIt2 d_last) { while (first != last) { *(--d_last) = std::move(*(--last)); } return d_last; } |
[编辑] 为例
| 本节是不完整的 原因: no example |
[编辑] 另请参阅
| (C++11) |
某一范围的元素移动到一个新的位置 Original: moves a range of elements to a new location The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数模板) |