tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
move_backward.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ALGORITHM_MOVE_BACKWARD_HPP
4#define TETL_ALGORITHM_MOVE_BACKWARD_HPP
5
7
8namespace etl {
9
23template <typename BidirIt1, typename BidirIt2>
24constexpr auto move_backward(BidirIt1 first, BidirIt1 last, BidirIt2 destination) -> BidirIt2
25{
26 for (; first != last;) {
27 --last;
28 *(--destination) = etl::move(*last);
29 }
30 return destination;
31}
32
33} // namespace etl
34
35#endif // TETL_ALGORITHM_MOVE_BACKWARD_HPP
constexpr auto move(InputIt first, InputIt last, OutputIt destination) -> OutputIt
Moves the elements in the range [first, last), to another range beginning at destination,...
Definition move.hpp:26
constexpr auto move_backward(BidirIt1 first, BidirIt1 last, BidirIt2 destination) -> BidirIt2
Moves the elements from the range [first, last), to another range ending at destination....
Definition move_backward.hpp:24
Definition adjacent_find.hpp:8