tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
iter_value_t.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2023 Tobias Hienzsch
3
4#ifndef TETL_ITERATOR_ITER_VALUE_T_HPP
5#define TETL_ITERATOR_ITER_VALUE_T_HPP
6
7#include <etl/_iterator/indirectly_readable_traits.hpp>
8#include <etl/_iterator/iterator_traits.hpp>
9#include <etl/_type_traits/is_specialized.hpp>
10#include <etl/_type_traits/remove_cvref.hpp>
11
12namespace etl {
13
14namespace detail {
15
16template <typename T>
17struct iter_value {
18 using type = typename etl::indirectly_readable_traits<etl::remove_cvref_t<T>>::value_type;
19};
20
21template <typename T>
22 requires(is_specialized_v<etl::iterator_traits, etl::remove_cvref_t<T>>)
23struct iter_value<T> {
24 using type = typename etl::iterator_traits<etl::remove_cvref_t<T>>::value_type;
25};
26
27} // namespace detail
28
29template <typename T>
30using iter_value_t = typename detail::iter_value<T>::type;
31
32} // namespace etl
33
34#endif // TETL_ITERATOR_ITER_VALUE_T_HPP
Definition adjacent_find.hpp:9
Definition indirectly_readable_traits.hpp:35
iterator_traits is the type trait class that provides uniform interface to the properties of LegacyIt...
Definition iterator_traits.hpp:48