Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
unwrap_reference.hpp
Go to the documentation of this file.
1// parasoft-begin-suppress AUTOSAR-A2_8_1-a "False positive: also defines arene::base::unwrap_reference"
2// Copyright 2026, Toyota Motor Corporation
3//
4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5
6#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_UNWRAP_REFERENCE_HPP_
7#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_UNWRAP_REFERENCE_HPP_
8
9// IWYU pragma: private, include "arene/base/type_traits.hpp"
10// IWYU pragma: friend "(arene/base(?!/tests)|stdlib/include/stdlib_detail)/.*"
11
12#include "arene/base/stdlib_choice/decay.hpp"
13#include "arene/base/stdlib_choice/reference_wrapper_fwd.hpp"
14#include "arene/base/type_traits/conditional.hpp"
15#include "arene/base/type_traits/is_instantiation_of.hpp"
16
17namespace arene {
18namespace base {
19namespace unwrap_reference_detail {
20
21/// @brief obtain the reference type of a std::reference_wrapper
22/// @tparam ReferenceWrapper specialization of std::reference_wrapper
23///
24/// Intended for use as a template alias argument to @c conditional_apply_t.
25template <class ReferenceWrapper>
26using reference_type_t = typename ReferenceWrapper::type&;
27
28} // namespace unwrap_reference_detail
29
30/// @brief Backport of @c std::unwrap_reference_t from C++20
31/// @tparam T A type from which to remove a @c std::reference_wrapper
32// parasoft-begin-suppress AUTOSAR-A2_7_3 "False positive: documented"
33template <class T>
38 T>;
39// parasoft-end-suppress AUTOSAR-A2_7_3
40
41/// @brief Backport of std::unwrap_reference from C++20
42/// @tparam T A type from which to remove a @c std::reference_wrapper
43// parasoft-begin-suppress AUTOSAR-A2_7_3 "False positive: documented"
44template <class T>
46 /// @brief The result type
48};
49// parasoft-end-suppress AUTOSAR-A2_7_3
50
51/// @brief Backport of @c std::unwrap_ref_decay_t from C++20
52/// @tparam T A type to decay and then unwrap a reference wrapper
53// parasoft-begin-suppress AUTOSAR-A2_7_3 "False positive: documented"
54template <class T>
56// parasoft-end-suppress AUTOSAR-A2_7_3
57
58/// @brief Backport of @c std::unwrap_ref_decay from C++20
59/// @tparam T A type to decay and then unwrap a reference wrapper
60// parasoft-begin-suppress AUTOSAR-A2_7_3 "False positive: documented"
61template <class T>
63 public:
64 /// @brief The decayed type @c T , subsequently unwrapped if applicable
66};
67// parasoft-end-suppress AUTOSAR-A2_7_3
68
69} // namespace base
70} // namespace arene
71
72#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_UNWRAP_REFERENCE_HPP_
Backport of std::unwrap_ref_decay from C++20.
Definition unwrap_reference.hpp:62
Definition array_exceptions_disabled.cpp:11
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10
Backport of std::unwrap_reference from C++20.
Definition unwrap_reference.hpp:45