tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_array.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_TYPE_TRAITS_IS_ARRAY_HPP
5#define TETL_TYPE_TRAITS_IS_ARRAY_HPP
6
7#include <etl/_cstddef/size_t.hpp>
8#include <etl/_type_traits/bool_constant.hpp>
9
10namespace etl {
11
12/// \brief Checks whether T is an array type. Provides the member constant value
13/// which is equal to true, if T is an array type. Otherwise, value is equal to
14/// false.
15///
16/// \details The behavior of a program that adds specializations for is_array or
17/// is_array_v is undefined.
18///
19/// \ingroup type_traits
20template <typename T>
21struct is_array : false_type { };
22
23template <typename T>
24struct is_array<T[]> : true_type { };
25
26template <typename T, size_t N>
27struct is_array<T[N]> : true_type { };
28
29/// \ingroup type_traits
30template <typename T>
31inline constexpr bool is_array_v = is_array<T>::value;
32
33} // namespace etl
34
35#endif // TETL_TYPE_TRAITS_IS_ARRAY_HPP
constexpr bool is_array_v
Definition is_array.hpp:31
Definition adjacent_find.hpp:9