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/// \details The behavior of a program that adds specializations for is_array or
16/// is_array_v is undefined.
17template <typename T>
18struct is_array : false_type { };
19
20template <typename T>
21struct is_array<T[]> : true_type { };
22
23template <typename T, size_t N>
24struct is_array<T[N]> : true_type { };
25
26template <typename T>
27inline constexpr bool is_array_v = is_array<T>::value;
28
29} // namespace etl
30
31#endif // TETL_TYPE_TRAITS_IS_ARRAY_HPP
Definition adjacent_find.hpp:9
constexpr bool is_array_v
Definition is_array.hpp:27