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
3#ifndef TETL_META_AT_HPP
4#define TETL_META_AT_HPP
5
7#include <etl/_meta/list.hpp>
8
9namespace etl::meta {
10
11template <etl::size_t I, typename List>
12struct at;
13
14template <typename Head, typename... Tail>
15struct at<0, list<Head, Tail...>> {
16 using type = Head;
17};
18
19template <etl::size_t I, typename Head, typename... Tail>
20struct at<I, list<Head, Tail...>> {
21 using type = typename at<I - 1, list<Tail...>>::type;
22};
23
24template <etl::size_t I, typename List>
25using at_t = typename at<I, List>::type;
26
27} // namespace etl::meta
28
29#endif // TETL_META_AT_HPP
Definition at.hpp:9
typename at< I, List >::type at_t
Definition at.hpp:25
TETL_BUILTIN_SIZET size_t
etl::size_t is the unsigned integer type of the result of the sizeof operator.
Definition size_t.hpp:14
typename at< I - 1, list< Tail... > >::type type
Definition at.hpp:21
Definition at.hpp:12
Definition list.hpp:10