Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_array.hpp
Go to the documentation of this file.
1// Copyright 2024, Toyota Motor Corporation
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5#ifndef INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_ARRAY_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_ARRAY_HPP_
7
8// parasoft-begin-suppress CERT_CPP-DCL58-a-2 "Part of a standard library implementation"
9// parasoft-begin-suppress AUTOSAR-A17_6_1-a-2 "Part of a standard library implementation"
10
11// IWYU pragma: private, include <type_traits>
12// IWYU pragma: friend "stdlib_detail/.*"
13
14#include "stdlib/include/stdlib_detail/cstddef.hpp"
15#include "stdlib/include/stdlib_detail/integral_constant.hpp"
16
17namespace std {
18
19/// @brief A type trait to check if a type is an @c array. The value is @c true if @c Type is an @c array, @c false
20/// otherwise.
21/// @tparam Type The type to check
22template <typename Type>
23extern constexpr bool is_array_v = false;
24
25/// @brief A type trait to check if a type is an @c array. The value is @c true if @c Type is an @c array, @c false
26/// otherwise.
27/// @tparam Type The type to check
28template <typename Type>
29// NOLINTNEXTLINE(hicpp-avoid-c-arrays)
30extern constexpr bool is_array_v<Type[]> = true;
31
32/// @brief A type trait to check if a type is an @c array. The value is @c true if @c Type is an @c array, @c false
33/// otherwise.
34/// @tparam Type The type to check
35template <typename Type, size_t N>
36// NOLINTNEXTLINE(hicpp-avoid-c-arrays)
37extern constexpr bool is_array_v<Type[N]> = true;
38
39/// @brief A type trait to check if a type is an @c array. The class is derived from @c true_type if @c Type is an
40/// @c array, @c false_type otherwise.
41/// @tparam Type The type to check
42template <typename Type>
44
45} // namespace std
46
47#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_ARRAY_HPP_
A type trait to check if a type is an array. The class is derived from true_type if Type is an array,...
Definition is_array.hpp:43
constexpr bool is_array_v< Type[]>
A type trait to check if a type is an array. The value is true if Type is an array,...
constexpr bool is_array_v
A type trait to check if a type is an array. The value is true if Type is an array,...
constexpr bool is_array_v< Type[N]>
A type trait to check if a type is an array. The value is true if Type is an array,...
constexpr auto operator()(::arene::base::result< void, E > const &value) const noexcept(noexcept(hash< E >{}(std::declval< E const & >()))) -> std::size_t
Calculate the hash of a result.
Definition result.hpp:1827