tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
at.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_MPL_AT_HPP
5#define TETL_MPL_AT_HPP
6
7#include <etl/_cstddef/size_t.hpp>
8#include <etl/_mpl/list.hpp>
9
10namespace etl::mpl {
11
12/// \ingroup mpl
13/// @{
14
15template <etl::size_t I, typename List>
16struct at;
17
18template <typename Head, typename... Tail>
19struct at<0, list<Head, Tail...>> {
20 using type = Head;
21};
22
23template <etl::size_t I, typename Head, typename... Tail>
24struct at<I, list<Head, Tail...>> {
25 using type = typename at<I - 1, list<Tail...>>::type;
26};
27
28template <etl::size_t I, typename List>
29using at_t = typename at<I, List>::type;
30
31/// @}
32
33} // namespace etl::mpl
34
35#endif // TETL_MPL_AT_HPP
Definition at.hpp:10
Definition adjacent_find.hpp:9
Definition list.hpp:11