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
21
namespace
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
25
template
<
typename
Type>
26
class
decay
{
27
private
:
28
/// @brief Reference-erased for building @c type
29
using
reference_erased_type
=
remove_reference_t
<
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
36
using
type
=
conditional_t
<
37
is_array_v
<
reference_erased_type
>,
38
add_pointer_t
<
remove_extent_t
<
reference_erased_type
>>,
39
conditional_t
<
40
is_function_v
<
reference_erased_type
>,
41
add_pointer_t
<
reference_erased_type
>,
42
remove_cv_t
<
reference_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
47
template
<
typename
Type>
48
using
decay_t =
typename
decay
<Type>::type;
49
50
}
// namespace std
51
52
#
endif
// INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_DECAY_HPP_
std::decay
Contains type, a conversion equivalent to those performed when passing function arguments by value.
Definition
decay.hpp:26
std::hash<::arene::base::result< void, E > >::operator()
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
stdlib
include
stdlib_detail
decay.hpp
Generated by
1.13.2