tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
reverse_copy.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ALGORITHM_REVERSE_COPY_HPP
4#define TETL_ALGORITHM_REVERSE_COPY_HPP
5
6namespace etl {
7
15template <typename BidirIt, typename OutputIt>
16constexpr auto reverse_copy(BidirIt first, BidirIt last, OutputIt destination) -> OutputIt
17{
18 for (; first != last; ++destination) {
19 *(destination) = *(--last);
20 }
21 return destination;
22}
23
24} // namespace etl
25
26#endif // TETL_ALGORITHM_REVERSE_COPY_HPP
constexpr auto reverse_copy(BidirIt first, BidirIt last, OutputIt destination) -> OutputIt
Copies the elements from the range [first, last) to another range beginning at d_first in such a way ...
Definition reverse_copy.hpp:16
Definition adjacent_find.hpp:8