tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
iter_swap.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_ALGORITHM_ITER_SWAP_HPP
5#define TETL_ALGORITHM_ITER_SWAP_HPP
6
7#include <etl/_utility/swap.hpp>
8
9namespace etl {
10
11/// \brief Swaps the values of the elements the given iterators are pointing to.
12///
13/// \param a Iterators to the elements to swap.
14/// \param b Iterators to the elements to swap.
15///
16/// https://en.cppreference.com/w/cpp/algorithm/iter_swap
17///
18/// \ingroup algorithm
19template <typename ForwardIt1, typename ForwardIt2>
20constexpr auto iter_swap(ForwardIt1 a, ForwardIt2 b) -> void
21{
22 using etl::swap;
23 swap(*a, *b);
24}
25
26} // namespace etl
27
28#endif // TETL_ALGORITHM_ITER_SWAP_HPP
constexpr auto iter_swap(ForwardIt1 a, ForwardIt2 b) -> void
Swaps the values of the elements the given iterators are pointing to.
Definition iter_swap.hpp:20
Definition adjacent_find.hpp:9