tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
legacy_forward_iterator.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2024 Tobias Hienzsch
3
4#ifndef TETL_ITERATOR_LEGACY_FORWARD_ITERATOR_HPP
5#define TETL_ITERATOR_LEGACY_FORWARD_ITERATOR_HPP
6
7#include <etl/_concepts/constructible_from.hpp>
8#include <etl/_concepts/convertible_to.hpp>
9#include <etl/_concepts/same_as.hpp>
10#include <etl/_iterator/indirectly_readable_traits.hpp>
11#include <etl/_iterator/iter_reference_t.hpp>
12#include <etl/_iterator/legacy_input_iterator.hpp>
13#include <etl/_type_traits/is_reference.hpp>
14#include <etl/_type_traits/remove_cvref.hpp>
15
16namespace etl {
17
18/// \note Non-standard extension
19/// \headerfile etl/iterator.hpp
20/// \ingroup iterator
21template <typename Iter>
22concept legacy_forward_iterator = legacy_input_iterator<Iter>
23 and etl::constructible_from<Iter>
24 and etl::is_reference_v<etl::iter_reference_t<Iter>>
25 and etl::same_as<
26 etl::remove_cvref_t<etl::iter_reference_t<Iter>>,
27 typename etl::indirectly_readable_traits<Iter>::value_type
28 >
29 and requires(Iter it) {
30 { it++ } -> etl::convertible_to<Iter const&>;
31 { *it++ } -> etl::same_as<etl::iter_reference_t<Iter>>;
32 };
33
34} // namespace etl
35
36#endif // TETL_ITERATOR_LEGACY_FORWARD_ITERATOR_HPP
Definition adjacent_find.hpp:9
Definition indirectly_readable_traits.hpp:35