Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_unsigned.hpp
Go to the documentation of this file.
1// Copyright 2026, 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_UNSIGNED_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_UNSIGNED_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/integral_constant.hpp"
15#include "stdlib/include/stdlib_detail/is_arithmetic.hpp"
16
17namespace std {
18
20/// @brief Implementation constant for @c std::is_unsigned_v The value is @c true if @c Type is an unsigned type, @c
21/// false otherwise.
22/// @tparam Type The type to check
23template <typename Type, bool = is_arithmetic_v<Type>>
24extern constexpr bool is_unsigned_v = false;
25
26/// @brief Implementation constant for @c std::is_unsigned_v The value is @c true if @c Type is an unsigned type, @c
27/// false otherwise.
28/// @tparam Type The type to check
29template <typename Type>
30extern constexpr bool is_unsigned_v<Type, true> = static_cast<Type>(0) < static_cast<Type>(-1);
31
32} // namespace is_unsigned_detail
33
34/// @brief A type trait to check if a type is unsigned. The value is @c true if @c Type is an unsigned type, @c false
35/// otherwise.
36/// @tparam Type The type to check
37template <typename Type>
38extern constexpr bool is_unsigned_v = is_unsigned_detail::is_unsigned_v<Type>;
39
40/// @brief A type trait to check if a type is unsigned. The class is derived from @c true_type if @c Type is an unsigned
41/// type, @c false_type otherwise.
42/// @tparam Type The type to check
43template <typename Type>
45
46} // namespace std
47
48#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_UNSIGNED_HPP_
A type trait to check if a type is unsigned. The class is derived from true_type if Type is an unsign...
Definition is_unsigned.hpp:44
Definition is_unsigned.hpp:19
constexpr bool is_unsigned_v< Type, true >
Implementation constant for std::is_unsigned_v The value is true if Type is an unsigned type,...
constexpr bool is_unsigned_v
Implementation constant for std::is_unsigned_v The value is true if Type is an unsigned type,...
constexpr bool is_unsigned_v
A type trait to check if a type is unsigned. The value is true if Type is an unsigned 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