std::move_backward

来自cppreference.com

 
 
算法库
功能
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
修改序列操作
Original:
Non-modifying sequence operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
all_of
any_of
none_of
(C++11)
(C++11)
(C++11)
for_each
count
count_if
mismatch
equal
修改序列操作
Original:
Modifying sequence operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
分区操作
Original:
Partitioning operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_partitioned(C++11)
partition
partition_copy(C++11)
排序操作(排序的区间)
Original:
Sorting operations (on sorted ranges)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_sorted(C++11)
is_sorted_until(C++11)
sort
二进制搜索操作(排序的区间)
Original:
Binary search operations (on sorted ranges)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
设置操作(排序的区间)
Original:
Set operations (on sorted ranges)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
堆的操作
Original:
Heap operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
最小/最大操作
Original:
Minimum/maximum operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
数字操作
Original:
Numeric operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
C库
Original:
C library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
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.

目录

[编辑] 参数

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.
You can help to correct and verify the translation. Click here for instructions.
</div></div></div></div>
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.

[编辑] 复杂性

究竟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.

[编辑] 可能的实现

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;
}

[编辑] 为例

[编辑] 另请参阅

(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.

(函数模板) [edit]

来自“http://zh.cppreference.com/mwiki/index.php?title=cpp/algorithm/move_backward&oldid=27916