Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_function.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_FUNCTION_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_FUNCTION_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_const.hpp"
16#include "stdlib/include/stdlib_detail/is_reference.hpp"
17
18namespace std {
19
20/// @brief A type trait to check if a type is a @c function. The value is @c true if @c Type is a @c function, @c false
21/// otherwise.
22/// Adding a cv-qualifier sequence on top of a function type causes the cv-qualifier to be ignored.
23/// @tparam Type The type to check
24template <typename Type>
25extern constexpr bool is_function_v = not is_const_v<Type const> and not is_reference_v<Type>;
26
27/// @brief A type trait to check if a type is a @c function. The class is derived from @c true_type if @c Type is a
28/// @c function, @c false_type otherwise.
29/// @tparam Type The type to check
30template <typename Type>
32
33} // namespace std
34
35#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_FUNCTION_HPP_
A type trait to check if a type is a function. The class is derived from true_type if Type is a funct...
Definition is_function.hpp:31
constexpr bool is_function_v
A type trait to check if a type is a function. The value is true if Type is a function,...
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