tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
copy_backward.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ALGORITHM_COPY_BACKWARD_HPP
4#define TETL_ALGORITHM_COPY_BACKWARD_HPP
5
6namespace etl {
7
17template <typename BidirIt1, typename BidirIt2>
18constexpr auto copy_backward(BidirIt1 first, BidirIt1 last, BidirIt2 dLast) -> BidirIt2
19{
20 while (first != last) {
21 *(--dLast) = *(--last);
22 }
23 return dLast;
24}
25
26} // namespace etl
27
28#endif // TETL_ALGORITHM_COPY_BACKWARD_HPP
constexpr auto copy_backward(BidirIt1 first, BidirIt1 last, BidirIt2 dLast) -> BidirIt2
Copies the elements from the range, defined by [first, last), to another range ending at dLast....
Definition copy_backward.hpp:18
Definition adjacent_find.hpp:8