Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
tuple_fwd.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_TUPLE_FWD_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_TUPLE_FWD_HPP_
7
8// IWYU pragma: private, include <tuple>
9// IWYU pragma: friend "stdlib_detail/.*"
10
11// parasoft-begin-suppress CERT_CPP-DCL58-a-2 "Part of a standard library implementation"
12// parasoft-begin-suppress AUTOSAR-A17_6_1-a-2 "Part of a standard library implementation"
13
14#include "stdlib/include/stdlib_detail/tuple_element.hpp"
15
16namespace std {
17
18/// @brief a heterogeneous, fixed-size collection of values
19/// @tparam Types the types of elements that the tuple stores
20template <class... Types>
21class tuple;
22//
23/// @brief access an element of a mutable lvalue reference to a @c tuple
24/// @tparam I index of the element to access
25/// @tparam Types types of the @c tuple
26/// @param tup @c tuple to access an element from
27/// @return reference to the @c I'th element of @c tup
28template <size_t I, class... Types>
29constexpr auto get(tuple<Types...>& tup) noexcept -> tuple_element_t<I, tuple<Types...>>&;
30
31/// @brief access an element of a const lvalue reference to a @c tuple
32/// @tparam I index of the element to access
33/// @tparam Types types of the @c tuple
34/// @param tup @c tuple to access an element from
35/// @return reference to the @c I'th element of @c tup
36template <size_t I, class... Types>
37constexpr auto get(tuple<Types...> const& tup) noexcept -> tuple_element_t<I, tuple<Types...>> const&;
38
39// parasoft-begin-suppress AUTOSAR-A8_4_6 "False positive: This is only the function declaration"
40// parasoft-begin-suppress AUTOSAR-A8_4_5 "False positive: This is only the function declaration"
41// parasoft-begin-suppress AUTOSAR-A12_8_4 "False positive: This is only the function declaration"
42/// @brief access an element of a mutable rvalue reference to a @c tuple
43/// @tparam I index of the element to access
44/// @tparam Types types of the @c tuple
45/// @param tup @c tuple to access an element from
46/// @return reference to the @c I'th element of @c tup
47template <size_t I, class... Types>
48constexpr auto get(tuple<Types...>&& tup) noexcept -> tuple_element_t<I, tuple<Types...>>&&;
49// parasoft-end-suppress AUTOSAR-A8_4_6
50// parasoft-end-suppress AUTOSAR-A8_4_5
51// parasoft-end-suppress AUTOSAR-A12_8_4
52
53/// @brief access an element of a const rvalue reference to a @c tuple
54/// @tparam I index of the element to access
55/// @tparam Types types of the @c tuple
56/// @param tup @c tuple to access an element from
57/// @return reference to the @c I'th element of @c tup
58template <size_t I, class... Types>
59constexpr auto get(tuple<Types...> const&& tup) noexcept -> tuple_element_t<I, tuple<Types...>> const&&;
60
61} // namespace std
62
63#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_TUPLE_FWD_HPP_
a heterogeneous, fixed-size collection of values
Definition tuple.hpp:681
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