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
12template <etl::size_t I, typename List>
13struct at;
14
15template <typename Head, typename... Tail>
16struct at<0, list<Head, Tail...>> {
17 using type = Head;
18};
19
20template <etl::size_t I, typename Head, typename... Tail>
21struct at<I, list<Head, Tail...>> {
22 using type = typename at<I - 1, list<Tail...>>::type;
23};
24
25template <etl::size_t I, typename List>
26using at_t = typename at<I, List>::type;
27
28} // namespace etl::mpl
29
30#endif // TETL_MPL_AT_HPP
Definition at.hpp:10
Definition adjacent_find.hpp:9
Definition list.hpp:11