Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_floating_point.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_FLOATING_POINT_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_FLOATING_POINT_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
18namespace std {
20/// @brief Implementation constant for @c std::is_floating_point_v The value is @c true if @c Type is a floating point
21/// type, @c false otherwise.
22/// @tparam Type The type to check
23/// @tparam Dummy A dummy parameter to allow specialization
24template <typename Type, nullptr_t Dummy = nullptr>
25extern constexpr bool is_floating_point_v = false;
26
27/// @brief Implementation constant for @c std::is_floating_point_v The value is @c true if @c Type is a floating point
28/// type, @c false otherwise.
29/// @tparam Dummy A dummy parameter to allow specialization
30template <nullptr_t Dummy>
31extern constexpr bool is_floating_point_v<float, Dummy> = true;
32
33/// @brief Implementation constant for @c std::is_floating_point_v The value is @c true if @c Type is a floating point
34/// type, @c false otherwise.
35/// @tparam Dummy A dummy parameter to allow specialization
36template <nullptr_t Dummy>
37extern constexpr bool is_floating_point_v<double, Dummy> = true;
38
39// parasoft-begin-suppress AUTOSAR-A0_4_2-a-2 "long double use required for correct implementation"
40/// @brief Implementation constant for @c std::is_floating_point_v The value is @c true if @c Type is a floating point
41/// type, @c false otherwise.
42/// @tparam Dummy A dummy parameter to allow specialization
43template <nullptr_t Dummy>
44extern constexpr bool is_floating_point_v<long double, Dummy> = true;
45// parasoft-end-suppress AUTOSAR-A0_4_2-a-2
46
47} // namespace is_floating_point_detail
48
49/// @brief A type trait to check if a type is floating point. The value is @c true if @c Type is a floating point type,
50/// @c false otherwise.
51/// @tparam Type The type to check
52template <typename Type>
54
55/// @brief A type trait to check if a type is floating point. The class is derived from @c true_type if @c Type is a
56/// floating point type, @c false_type otherwise.
57/// @tparam Type The type to check
58template <typename Type>
60
61} // namespace std
62
63#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_FLOATING_POINT_HPP_
A type trait to check if a type is floating point. The class is derived from true_type if Type is a f...
Definition is_floating_point.hpp:59
Definition is_floating_point.hpp:19
constexpr bool is_floating_point_v
Implementation constant for std::is_floating_point_v The value is true if Type is a floating point ty...
constexpr bool is_floating_point_v< long double, Dummy >
Implementation constant for std::is_floating_point_v The value is true if Type is a floating point ty...
constexpr bool is_floating_point_v< float, Dummy >
Implementation constant for std::is_floating_point_v The value is true if Type is a floating point ty...
constexpr bool is_floating_point_v< double, Dummy >
Implementation constant for std::is_floating_point_v The value is true if Type is a floating point ty...
constexpr bool is_floating_point_v
A type trait to check if a type is floating point. The value is true if Type is a floating point 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