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
// SPDX-FileCopyrightText: Copyright (C) 2021 Tobias Hienzsch
3
4
#
ifndef
TETL_TYPE_TRAITS_RANK_HPP
5
#
define
TETL_TYPE_TRAITS_RANK_HPP
6
7
#
include
<
etl
/
_cstddef
/
size_t
.
hpp
>
8
#
include
<
etl
/
_type_traits
/
integral_constant
.
hpp
>
9
10
namespace
etl
{
11
12
/// \brief If Type is an array type, provides the member constant value equal to
13
/// the number of dimensions of the array. For any other type, value is 0. The
14
/// behavior of a program that adds specializations for rank or rank_v is
15
/// undefined.
16
template
<
typename
T>
17
struct
rank
:
integral_constant
<size_t, 0> { };
18
19
template
<
typename
T>
20
struct
rank
<T[]> :
integral_constant
<size_t,
rank
<T>::value + 1> { };
21
22
template
<
typename
T, size_t N>
23
struct
rank
<T[N]> :
integral_constant
<size_t,
rank
<T>::value + 1> { };
24
25
template
<
typename
Type
>
26
inline
constexpr
size_t
rank_v
=
rank
<
Type
>::
value
;
27
28
}
// namespace etl
29
30
#
endif
// TETL_TYPE_TRAITS_RANK_HPP
etl
Definition
adjacent_find.hpp:9
etl::rank_v
constexpr size_t rank_v
Definition
rank.hpp:26
etl::integral_constant
Definition
integral_constant.hpp:10
etl::rank
If Type is an array type, provides the member constant value equal to the number of dimensions of the...
Definition
rank.hpp:17
include
etl
_type_traits
rank.hpp
Generated on Sun Sep 7 2025 19:15:18 for tetl by
1.9.8