tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
rank.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_TYPE_TRAITS_RANK_HPP
4#define TETL_TYPE_TRAITS_RANK_HPP
5
8
9namespace etl {
10
15template <typename T>
16struct rank : integral_constant<size_t, 0> { };
17
18template <typename T>
19struct rank<T[]> : integral_constant<size_t, rank<T>::value + 1> { };
20
21template <typename T, size_t N>
22struct rank<T[N]> : integral_constant<size_t, rank<T>::value + 1> { };
23
24template <typename Type>
25inline constexpr size_t rank_v = rank<Type>::value;
26
27} // namespace etl
28
29#endif // TETL_TYPE_TRAITS_RANK_HPP
Definition adjacent_find.hpp:8
constexpr size_t rank_v
Definition rank.hpp:25
Definition integral_constant.hpp:9
static constexpr size_t value
Definition integral_constant.hpp:10
If Type is an array type, provides the member constant value equal to the number of dimensions of the...
Definition rank.hpp:16