Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
decay.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_DECAY_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_DECAY_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/add_pointer.hpp"
15#include "stdlib/include/stdlib_detail/conditional.hpp"
16#include "stdlib/include/stdlib_detail/is_array.hpp"
17#include "stdlib/include/stdlib_detail/is_function.hpp"
18#include "stdlib/include/stdlib_detail/remove_cv.hpp"
19#include "stdlib/include/stdlib_detail/remove_extent.hpp"
20
21namespace std {
22
23/// @brief Contains @c type, a conversion equivalent to those performed when passing function arguments by value
24/// @tparam Type The type to decay
25template <typename Type>
26class decay {
27 private:
28 /// @brief Reference-erased for building @c type
30
31 public:
32 /// @brief The converted type
33 /// For arrays: A reference-erased element pointer type
34 /// For functions: A reference-erased pointer type
35 /// Otherwise: A reference and cv-erased type
43};
44
45/// @brief A conversion equivalent to those performed when passing function arguments by value
46/// @tparam Type The type to decay
47template <typename Type>
48using decay_t = typename decay<Type>::type;
49
50} // namespace std
51
52#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_DECAY_HPP_
Contains type, a conversion equivalent to those performed when passing function arguments by value.
Definition decay.hpp:26
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