tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
next.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_ITERATOR_NEXT_HPP
5#define TETL_ITERATOR_NEXT_HPP
6
7#include <etl/_iterator/advance.hpp>
8#include <etl/_iterator/iterator_traits.hpp>
9
10namespace etl {
11
12/// Return the nth successor of iterator it.
13/// \ingroup iterator
14template <typename InputIt>
15[[nodiscard]] constexpr auto next(InputIt it, typename iterator_traits<InputIt>::difference_type n = 1) -> InputIt
16{
17 etl::advance(it, n);
18 return it;
19}
20
21} // namespace etl
22
23#endif // TETL_ITERATOR_NEXT_HPP
constexpr auto next(InputIt it, typename iterator_traits< InputIt >::difference_type n=1) -> InputIt
Return the nth successor of iterator it.
Definition next.hpp:15
Definition adjacent_find.hpp:9
iterator_traits is the type trait class that provides uniform interface to the properties of LegacyIt...
Definition iterator_traits.hpp:48