Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_integral.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_INTEGRAL_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_INTEGRAL_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#include "stdlib/include/stdlib_detail/remove_cv.hpp"
17
18// parasoft-begin-suppress AUTOSAR-A3_9_1-b-2 "Built in types must be explicitly specified to ensure correctness"
19
20namespace std {
22/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
23/// false otherwise.
24/// @tparam Type The type to check
25/// @tparam Dummy A dummy parameter to allow specialization
26template <typename Type, nullptr_t Dummy = nullptr>
27extern constexpr bool is_integral_v = false;
28
29/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
30/// false otherwise.
31/// @tparam Dummy A dummy parameter to allow specialization
32template <nullptr_t Dummy>
33extern constexpr bool is_integral_v<char, Dummy> = true;
34
35/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
36/// false otherwise.
37/// @tparam Dummy A dummy parameter to allow specialization
38template <nullptr_t Dummy>
39extern constexpr bool is_integral_v<signed char, Dummy> = true;
40
41/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
42/// false otherwise.
43/// @tparam Dummy A dummy parameter to allow specialization
44template <nullptr_t Dummy>
45extern constexpr bool is_integral_v<unsigned char, Dummy> = true;
46
47/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
48/// false otherwise.
49/// @tparam Dummy A dummy parameter to allow specialization
50template <nullptr_t Dummy>
51extern constexpr bool is_integral_v<int, Dummy> = true;
52
53/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
54/// false otherwise.
55/// @tparam Dummy A dummy parameter to allow specialization
56template <nullptr_t Dummy>
57extern constexpr bool is_integral_v<unsigned, Dummy> = true;
58
59/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
60/// false otherwise.
61/// @tparam Dummy A dummy parameter to allow specialization
62template <nullptr_t Dummy>
63// NOLINTNEXTLINE(google-runtime-int)
64extern constexpr bool is_integral_v<short, Dummy> = true;
65
66/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
67/// false otherwise.
68/// @tparam Dummy A dummy parameter to allow specialization
69template <nullptr_t Dummy>
70// NOLINTNEXTLINE(google-runtime-int)
71extern constexpr bool is_integral_v<unsigned short, Dummy> = true;
72
73/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
74/// false otherwise.
75/// @tparam Dummy A dummy parameter to allow specialization
76template <nullptr_t Dummy>
77// NOLINTNEXTLINE(google-runtime-int)
78extern constexpr bool is_integral_v<long, Dummy> = true;
79
80/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
81/// false otherwise.
82/// @tparam Dummy A dummy parameter to allow specialization
83template <nullptr_t Dummy>
84// NOLINTNEXTLINE(google-runtime-int)
85extern constexpr bool is_integral_v<unsigned long, Dummy> = true;
86
87/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
88/// false otherwise.
89/// @tparam Dummy A dummy parameter to allow specialization
90template <nullptr_t Dummy>
91// NOLINTNEXTLINE(google-runtime-int)
92extern constexpr bool is_integral_v<long long, Dummy> = true;
93
94/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
95/// false otherwise.
96/// @tparam Dummy A dummy parameter to allow specialization
97template <nullptr_t Dummy>
98// NOLINTNEXTLINE(google-runtime-int)
99extern constexpr bool is_integral_v<unsigned long long, Dummy> = true;
100
101// parasoft-begin-suppress AUTOSAR-A2_13_3-a-2 "wchar_t must be explicitly specified to ensure correctness"
102/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
103/// false otherwise.
104/// @tparam Dummy A dummy parameter to allow specialization
105template <nullptr_t Dummy>
106extern constexpr bool is_integral_v<wchar_t, Dummy> = true;
107// parasoft-end-suppress AUTOSAR-A2_13_3-a-2
108
109/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
110/// false otherwise.
111/// @tparam Dummy A dummy parameter to allow specialization
112template <nullptr_t Dummy>
113extern constexpr bool is_integral_v<char16_t, Dummy> = true;
114
115/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
116/// false otherwise.
117/// @tparam Dummy A dummy parameter to allow specialization
118template <nullptr_t Dummy>
119extern constexpr bool is_integral_v<char32_t, Dummy> = true;
120
121/// @brief Implementation constant for @c std::is_integral_v The value is @c true if @c Type is an integral type, @c
122/// false otherwise.
123/// @tparam Dummy A dummy parameter to allow specialization
124template <nullptr_t Dummy>
125extern constexpr bool is_integral_v<bool, Dummy> = true;
126
127} // namespace is_integral_detail
128
129/// @brief A type trait to check if a type is integral. The value is @c true if @c Type is an integral type, @c false
130/// otherwise.
131/// @tparam Type The type to check
132template <typename Type>
134
135/// @brief A type trait to check if a type is integral. The class is derived from @c true_type if @c Type is an integral
136/// type, @c false_type otherwise.
137/// @tparam Type The type to check
138template <typename Type>
140
141} // namespace std
142
143#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_INTEGRAL_HPP_
A type trait to check if a type is integral. The class is derived from true_type if Type is an integr...
Definition is_integral.hpp:139
Definition is_integral.hpp:21
constexpr bool is_integral_v< unsigned long, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< long long, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< char, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< signed char, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< int, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< unsigned char, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< char32_t, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< long, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< short, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< unsigned short, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< char16_t, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< wchar_t, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< unsigned, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< unsigned long long, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v< bool, Dummy >
Implementation constant for std::is_integral_v The value is true if Type is an integral type,...
constexpr bool is_integral_v
A type trait to check if a type is integral. The value is true if Type is an integral type,...
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