Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <AK/StdLibExtras.h> |
10 | | #include <AK/TypeList.h> |
11 | | |
12 | | namespace AK::Detail { |
13 | | |
14 | | template<typename... Ts> |
15 | | struct Tuple { |
16 | | }; |
17 | | |
18 | | template<typename T> |
19 | | struct Tuple<T> { |
20 | | Tuple(T&& value) |
21 | | requires(!IsSame < T &&, T const& >) |
22 | 1.42M | : value(forward<T>(value)) |
23 | 1.42M | { |
24 | 1.42M | } _ZN2AK6Detail5TupleIJN4IMAP17FetchResponseDataEEEC2EOS3_Qnt6IsSameIOT_RKS6_E Line | Count | Source | 22 | 1.01M | : value(forward<T>(value)) | 23 | 1.01M | { | 24 | 1.01M | } |
Unexecuted instantiation: _ZN2AK6Detail5TupleIJNS_13NonnullOwnPtrIN4IMAP13BodyStructureEEEEEC2EOS5_Qnt6IsSameIOT_RKS8_E _ZN2AK6Detail5TupleIJNS_10ByteStringEEEC2EOS2_Qnt6IsSameIOT_RKS5_E Line | Count | Source | 22 | 377k | : value(forward<T>(value)) | 23 | 377k | { | 24 | 377k | } |
_ZN2AK6Detail5TupleIJNS_7HashMapINS_10ByteStringES3_NS_6TraitsIS3_EES5_Lb0EEEEEC2EOS6_Qnt6IsSameIOT_RKS9_E Line | Count | Source | 22 | 28.2k | : value(forward<T>(value)) | 23 | 28.2k | { | 24 | 28.2k | } |
Unexecuted instantiation: _ZN2AK6Detail5TupleIJNS_8OptionalIRmEEEEC2EOS4_Qnt6IsSameIOT_RKS7_E Unexecuted instantiation: _ZN2AK6Detail5TupleIJhEEC2EOhQnt6IsSameIOT_RKS4_E Unexecuted instantiation: _ZN2AK6Detail5TupleIJPKcEEC2EOS3_Qnt6IsSameIOT_RKS6_E |
25 | | |
26 | | Tuple(T const& value) |
27 | | : value(value) |
28 | | { |
29 | | } |
30 | | |
31 | | template<typename U> |
32 | | U& get() |
33 | | { |
34 | | static_assert(IsSame<T, U>, "Invalid tuple access"); |
35 | | return value; |
36 | | } |
37 | | |
38 | | template<typename U> |
39 | | U const& get() const |
40 | | { |
41 | | return const_cast<Tuple<T>&>(*this).get<U>(); |
42 | | } |
43 | | |
44 | | template<typename U, size_t index> |
45 | | U& get_with_index() |
46 | 1.18M | { |
47 | 1.18M | static_assert(IsSame<T, U> && index == 0, "Invalid tuple access"); |
48 | 1.18M | return value; |
49 | 1.18M | } Unexecuted instantiation: unsigned char& AK::Detail::Tuple<unsigned char>::get_with_index<unsigned char, 0ul>() Unexecuted instantiation: AK::NonnullOwnPtr<IMAP::BodyStructure>& AK::Detail::Tuple<AK::NonnullOwnPtr<IMAP::BodyStructure> >::get_with_index<AK::NonnullOwnPtr<IMAP::BodyStructure>, 0ul>() AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false>& AK::Detail::Tuple<AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >::get_with_index<AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false>, 0ul>() Line | Count | Source | 46 | 26.9k | { | 47 | 26.9k | static_assert(IsSame<T, U> && index == 0, "Invalid tuple access"); | 48 | 26.9k | return value; | 49 | 26.9k | } |
AK::ByteString& AK::Detail::Tuple<AK::ByteString>::get_with_index<AK::ByteString, 0ul>() Line | Count | Source | 46 | 310k | { | 47 | 310k | static_assert(IsSame<T, U> && index == 0, "Invalid tuple access"); | 48 | 310k | return value; | 49 | 310k | } |
IMAP::FetchResponseData& AK::Detail::Tuple<IMAP::FetchResponseData>::get_with_index<IMAP::FetchResponseData, 0ul>() Line | Count | Source | 46 | 847k | { | 47 | 847k | static_assert(IsSame<T, U> && index == 0, "Invalid tuple access"); | 48 | 847k | return value; | 49 | 847k | } |
Unexecuted instantiation: AK::Optional<unsigned long&>& AK::Detail::Tuple<AK::Optional<unsigned long&> >::get_with_index<AK::Optional<unsigned long&>, 0ul>() Unexecuted instantiation: char const*& AK::Detail::Tuple<char const*>::get_with_index<char const*, 0ul>() |
50 | | |
51 | | template<typename U, size_t index> |
52 | | U const& get_with_index() const |
53 | | { |
54 | | return const_cast<Tuple<T>&>(*this).get_with_index<U, index>(); |
55 | | } |
56 | | |
57 | | private: |
58 | | T value; |
59 | | }; |
60 | | |
61 | | template<typename T, typename... TRest> |
62 | | struct Tuple<T, TRest...> : Tuple<TRest...> { |
63 | | |
64 | | template<typename FirstT, typename... RestT> |
65 | | Tuple(FirstT&& first, RestT&&... rest) |
66 | 1.32k | : Tuple<TRest...>(forward<RestT>(rest)...) |
67 | 1.32k | , value(forward<FirstT>(first)) |
68 | 1.32k | { |
69 | 1.32k | } AK::Detail::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >::Tuple<AK::StringView, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >(AK::StringView&&, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false>&&) Line | Count | Source | 66 | 1.32k | : Tuple<TRest...>(forward<RestT>(rest)...) | 67 | 1.32k | , value(forward<FirstT>(first)) | 68 | 1.32k | { | 69 | 1.32k | } |
Unexecuted instantiation: AK::Detail::Tuple<unsigned long, unsigned char, unsigned char>::Tuple<unsigned long&, unsigned int&, unsigned int&>(unsigned long&, unsigned int&, unsigned int&) Unexecuted instantiation: AK::Detail::Tuple<unsigned char, unsigned char>::Tuple<unsigned int&, unsigned int&>(unsigned int&, unsigned int&) |
70 | | |
71 | | Tuple(T&& first, TRest&&... rest) |
72 | 1.42M | : Tuple<TRest...>(move(rest)...) |
73 | 1.01M | , value(move(first)) |
74 | 1.42M | { |
75 | 1.42M | } AK::Detail::Tuple<unsigned int, IMAP::FetchResponseData>::Tuple(unsigned int&&, IMAP::FetchResponseData&&) Line | Count | Source | 72 | 1.01M | : Tuple<TRest...>(move(rest)...) | 73 | 1.01M | , value(move(first)) | 74 | 1.01M | { | 75 | 1.01M | } |
Unexecuted instantiation: AK::Detail::Tuple<IMAP::Envelope, AK::NonnullOwnPtr<IMAP::BodyStructure> >::Tuple(IMAP::Envelope&&, AK::NonnullOwnPtr<IMAP::BodyStructure>&&) AK::Detail::Tuple<IMAP::FetchCommand::DataItem, AK::ByteString>::Tuple(IMAP::FetchCommand::DataItem&&, AK::ByteString&&) Line | Count | Source | 72 | 377k | : Tuple<TRest...>(move(rest)...) | 73 | 377k | , value(move(first)) | 74 | 377k | { | 75 | 377k | } |
AK::Detail::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >::Tuple(AK::ByteString&&, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false>&&) Line | Count | Source | 72 | 26.9k | : Tuple<TRest...>(move(rest)...) | 73 | 26.9k | , value(move(first)) | 74 | 26.9k | { | 75 | 26.9k | } |
Unexecuted instantiation: AK::Detail::Tuple<AK::Optional<unsigned long&>, AK::Optional<unsigned long&> >::Tuple(AK::Optional<unsigned long&>&&, AK::Optional<unsigned long&>&&) |
76 | | |
77 | | template<typename U> |
78 | | U& get() |
79 | | { |
80 | | if constexpr (IsSame<T, U>) |
81 | | return value; |
82 | | else |
83 | | return Tuple<TRest...>::template get<U>(); |
84 | | } |
85 | | |
86 | | template<typename U> |
87 | | U const& get() const |
88 | | { |
89 | | return const_cast<Tuple<T, TRest...>&>(*this).get<U>(); |
90 | | } |
91 | | |
92 | | template<typename U, size_t index> |
93 | | U& get_with_index() |
94 | 2.37M | { |
95 | | if constexpr (IsSame<T, U> && index == 0) |
96 | 1.18M | return value; |
97 | | else |
98 | 1.18M | return Tuple<TRest...>::template get_with_index<U, index - 1>(); |
99 | 2.37M | } Unexecuted instantiation: long& AK::Detail::Tuple<long, unsigned char, unsigned char>::get_with_index<long, 0ul>() Unexecuted instantiation: unsigned char& AK::Detail::Tuple<long, unsigned char, unsigned char>::get_with_index<unsigned char, 1ul>() Unexecuted instantiation: unsigned char& AK::Detail::Tuple<unsigned char, unsigned char>::get_with_index<unsigned char, 0ul>() Unexecuted instantiation: unsigned char& AK::Detail::Tuple<long, unsigned char, unsigned char>::get_with_index<unsigned char, 2ul>() Unexecuted instantiation: unsigned char& AK::Detail::Tuple<unsigned char, unsigned char>::get_with_index<unsigned char, 1ul>() Unexecuted instantiation: IMAP::Envelope& AK::Detail::Tuple<IMAP::Envelope, AK::NonnullOwnPtr<IMAP::BodyStructure> >::get_with_index<IMAP::Envelope, 0ul>() Unexecuted instantiation: AK::NonnullOwnPtr<IMAP::BodyStructure>& AK::Detail::Tuple<IMAP::Envelope, AK::NonnullOwnPtr<IMAP::BodyStructure> >::get_with_index<AK::NonnullOwnPtr<IMAP::BodyStructure>, 1ul>() AK::ByteString& AK::Detail::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >::get_with_index<AK::ByteString, 0ul>() Line | Count | Source | 94 | 26.9k | { | 95 | | if constexpr (IsSame<T, U> && index == 0) | 96 | 26.9k | return value; | 97 | | else | 98 | | return Tuple<TRest...>::template get_with_index<U, index - 1>(); | 99 | 26.9k | } |
AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false>& AK::Detail::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >::get_with_index<AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false>, 1ul>() Line | Count | Source | 94 | 26.9k | { | 95 | | if constexpr (IsSame<T, U> && index == 0) | 96 | | return value; | 97 | | else | 98 | 26.9k | return Tuple<TRest...>::template get_with_index<U, index - 1>(); | 99 | 26.9k | } |
IMAP::FetchCommand::DataItem& AK::Detail::Tuple<IMAP::FetchCommand::DataItem, AK::ByteString>::get_with_index<IMAP::FetchCommand::DataItem, 0ul>() Line | Count | Source | 94 | 310k | { | 95 | | if constexpr (IsSame<T, U> && index == 0) | 96 | 310k | return value; | 97 | | else | 98 | | return Tuple<TRest...>::template get_with_index<U, index - 1>(); | 99 | 310k | } |
AK::ByteString& AK::Detail::Tuple<IMAP::FetchCommand::DataItem, AK::ByteString>::get_with_index<AK::ByteString, 1ul>() Line | Count | Source | 94 | 310k | { | 95 | | if constexpr (IsSame<T, U> && index == 0) | 96 | | return value; | 97 | | else | 98 | 310k | return Tuple<TRest...>::template get_with_index<U, index - 1>(); | 99 | 310k | } |
unsigned int& AK::Detail::Tuple<unsigned int, IMAP::FetchResponseData>::get_with_index<unsigned int, 0ul>() Line | Count | Source | 94 | 847k | { | 95 | | if constexpr (IsSame<T, U> && index == 0) | 96 | 847k | return value; | 97 | | else | 98 | | return Tuple<TRest...>::template get_with_index<U, index - 1>(); | 99 | 847k | } |
IMAP::FetchResponseData& AK::Detail::Tuple<unsigned int, IMAP::FetchResponseData>::get_with_index<IMAP::FetchResponseData, 1ul>() Line | Count | Source | 94 | 847k | { | 95 | | if constexpr (IsSame<T, U> && index == 0) | 96 | | return value; | 97 | | else | 98 | 847k | return Tuple<TRest...>::template get_with_index<U, index - 1>(); | 99 | 847k | } |
Unexecuted instantiation: AK::Optional<unsigned long&>& AK::Detail::Tuple<AK::Optional<unsigned long&>, AK::Optional<unsigned long&> >::get_with_index<AK::Optional<unsigned long&>, 0ul>() Unexecuted instantiation: AK::Optional<unsigned long&>& AK::Detail::Tuple<AK::Optional<unsigned long&>, AK::Optional<unsigned long&> >::get_with_index<AK::Optional<unsigned long&>, 1ul>() Unexecuted instantiation: unsigned long& AK::Detail::Tuple<unsigned long, unsigned char, unsigned char>::get_with_index<unsigned long, 0ul>() Unexecuted instantiation: unsigned char& AK::Detail::Tuple<unsigned long, unsigned char, unsigned char>::get_with_index<unsigned char, 1ul>() Unexecuted instantiation: unsigned char& AK::Detail::Tuple<unsigned long, unsigned char, unsigned char>::get_with_index<unsigned char, 2ul>() |
100 | | |
101 | | template<typename U, size_t index> |
102 | | U const& get_with_index() const |
103 | | { |
104 | | return const_cast<Tuple<T, TRest...>&>(*this).get_with_index<U, index>(); |
105 | | } |
106 | | |
107 | | private: |
108 | | T value; |
109 | | }; |
110 | | |
111 | | } |
112 | | |
113 | | namespace AK { |
114 | | |
115 | | template<typename... Ts> |
116 | | struct Tuple : Detail::Tuple<Ts...> { |
117 | | using Types = TypeList<Ts...>; |
118 | | using Detail::Tuple<Ts...>::Tuple; |
119 | | using Indices = MakeIndexSequence<sizeof...(Ts)>; |
120 | | |
121 | | Tuple(Tuple&& other) |
122 | 1.18M | : Tuple(move(other), Indices()) |
123 | 1.18M | { |
124 | 1.18M | } AK::Tuple<unsigned int, IMAP::FetchResponseData>::Tuple(AK::Tuple<unsigned int, IMAP::FetchResponseData>&&) Line | Count | Source | 122 | 847k | : Tuple(move(other), Indices()) | 123 | 847k | { | 124 | 847k | } |
Unexecuted instantiation: AK::Tuple<IMAP::Envelope, AK::NonnullOwnPtr<IMAP::BodyStructure> >::Tuple(AK::Tuple<IMAP::Envelope, AK::NonnullOwnPtr<IMAP::BodyStructure> >&&) AK::Tuple<IMAP::FetchCommand::DataItem, AK::ByteString>::Tuple(AK::Tuple<IMAP::FetchCommand::DataItem, AK::ByteString>&&) Line | Count | Source | 122 | 310k | : Tuple(move(other), Indices()) | 123 | 310k | { | 124 | 310k | } |
AK::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >::Tuple(AK::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >&&) Line | Count | Source | 122 | 26.9k | : Tuple(move(other), Indices()) | 123 | 26.9k | { | 124 | 26.9k | } |
|
125 | | |
126 | | Tuple(Tuple const& other) |
127 | | : Tuple(other, Indices()) |
128 | | { |
129 | | } |
130 | | |
131 | | Tuple& operator=(Tuple&& other) |
132 | 0 | { |
133 | 0 | set(move(other), Indices()); |
134 | 0 | return *this; |
135 | 0 | } Unexecuted instantiation: AK::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >::operator=(AK::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >&&) Unexecuted instantiation: AK::Tuple<IMAP::Envelope, AK::NonnullOwnPtr<IMAP::BodyStructure> >::operator=(AK::Tuple<IMAP::Envelope, AK::NonnullOwnPtr<IMAP::BodyStructure> >&&) |
136 | | |
137 | | Tuple& operator=(Tuple const& other) |
138 | | { |
139 | | set(other, Indices()); |
140 | | return *this; |
141 | | } |
142 | | |
143 | | template<typename T> |
144 | | auto& get() & |
145 | | { |
146 | | return Detail::Tuple<Ts...>::template get<T>(); |
147 | | } |
148 | | |
149 | | template<typename T> |
150 | | auto&& get() && |
151 | | { |
152 | | return move(Detail::Tuple<Ts...>::template get<T>()); |
153 | | } |
154 | | |
155 | | template<size_t index> |
156 | | auto& get() & |
157 | 2.37M | { |
158 | 2.37M | return Detail::Tuple<Ts...>::template get_with_index<typename Types::template Type<index>, index>(); |
159 | 2.37M | } Unexecuted instantiation: auto& AK::Tuple<IMAP::Envelope, AK::NonnullOwnPtr<IMAP::BodyStructure> >::get<0ul>() & Unexecuted instantiation: auto& AK::Tuple<IMAP::Envelope, AK::NonnullOwnPtr<IMAP::BodyStructure> >::get<1ul>() & auto& AK::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >::get<0ul>() & Line | Count | Source | 157 | 26.9k | { | 158 | 26.9k | return Detail::Tuple<Ts...>::template get_with_index<typename Types::template Type<index>, index>(); | 159 | 26.9k | } |
auto& AK::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >::get<1ul>() & Line | Count | Source | 157 | 26.9k | { | 158 | 26.9k | return Detail::Tuple<Ts...>::template get_with_index<typename Types::template Type<index>, index>(); | 159 | 26.9k | } |
auto& AK::Tuple<IMAP::FetchCommand::DataItem, AK::ByteString>::get<0ul>() & Line | Count | Source | 157 | 310k | { | 158 | 310k | return Detail::Tuple<Ts...>::template get_with_index<typename Types::template Type<index>, index>(); | 159 | 310k | } |
auto& AK::Tuple<IMAP::FetchCommand::DataItem, AK::ByteString>::get<1ul>() & Line | Count | Source | 157 | 310k | { | 158 | 310k | return Detail::Tuple<Ts...>::template get_with_index<typename Types::template Type<index>, index>(); | 159 | 310k | } |
auto& AK::Tuple<unsigned int, IMAP::FetchResponseData>::get<0ul>() & Line | Count | Source | 157 | 847k | { | 158 | 847k | return Detail::Tuple<Ts...>::template get_with_index<typename Types::template Type<index>, index>(); | 159 | 847k | } |
auto& AK::Tuple<unsigned int, IMAP::FetchResponseData>::get<1ul>() & Line | Count | Source | 157 | 847k | { | 158 | 847k | return Detail::Tuple<Ts...>::template get_with_index<typename Types::template Type<index>, index>(); | 159 | 847k | } |
Unexecuted instantiation: auto& AK::Tuple<AK::Optional<unsigned long&>, AK::Optional<unsigned long&> >::get<0ul>() & Unexecuted instantiation: auto& AK::Tuple<AK::Optional<unsigned long&>, AK::Optional<unsigned long&> >::get<1ul>() & Unexecuted instantiation: auto& AK::Tuple<char const*>::get<0ul>() & |
160 | | |
161 | | template<size_t index> |
162 | | auto&& get() && |
163 | 0 | { |
164 | 0 | return move(Detail::Tuple<Ts...>::template get_with_index<typename Types::template Type<index>, index>()); |
165 | 0 | } Unexecuted instantiation: auto&& AK::Tuple<long, unsigned char, unsigned char>::get<0ul>() && Unexecuted instantiation: auto&& AK::Tuple<long, unsigned char, unsigned char>::get<1ul>() && Unexecuted instantiation: auto&& AK::Tuple<long, unsigned char, unsigned char>::get<2ul>() && Unexecuted instantiation: auto&& AK::Tuple<unsigned long, unsigned char, unsigned char>::get<0ul>() && Unexecuted instantiation: auto&& AK::Tuple<unsigned long, unsigned char, unsigned char>::get<1ul>() && Unexecuted instantiation: auto&& AK::Tuple<unsigned long, unsigned char, unsigned char>::get<2ul>() && |
166 | | |
167 | | template<typename T> |
168 | | auto& get() const& |
169 | | { |
170 | | return Detail::Tuple<Ts...>::template get<T>(); |
171 | | } |
172 | | |
173 | | template<typename T> |
174 | | auto&& get() const&& |
175 | | { |
176 | | return move(Detail::Tuple<Ts...>::template get<T>()); |
177 | | } |
178 | | |
179 | | template<size_t index> |
180 | | auto& get() const& |
181 | | { |
182 | | return Detail::Tuple<Ts...>::template get_with_index<typename Types::template Type<index>, index>(); |
183 | | } |
184 | | |
185 | | template<size_t index> |
186 | | auto&& get() const&& |
187 | | { |
188 | | return move(Detail::Tuple<Ts...>::template get_with_index<typename Types::template Type<index>, index>()); |
189 | | } |
190 | | |
191 | | template<typename F> |
192 | | auto apply_as_args(F&& f) |
193 | 0 | { |
194 | 0 | return apply_as_args(forward<F>(f), Indices()); |
195 | 0 | } Unexecuted instantiation: Shell.cpp:auto AK::Tuple<AK::Optional<unsigned long&>, AK::Optional<unsigned long&> >::apply_as_args<Shell::do_escape<unsigned long, unsigned long, AK::ByteString>(Shell::Shell::EscapeMode, AK::ByteString&, unsigned long&, unsigned long&)::{lambda()#1}::operator()() const::{lambda<typename... $T0>(($T0&)...)#1}>(Shell::do_escape<unsigned long, unsigned long, AK::ByteString>(Shell::Shell::EscapeMode, AK::ByteString&, unsigned long&, unsigned long&)::{lambda()#1}::operator()() const::{lambda<typename... $T0>(($T0&)...)#1}&&)Unexecuted instantiation: Shell.cpp:auto AK::Tuple<>::apply_as_args<Shell::do_escape<, AK::Utf32View>(Shell::Shell::EscapeMode, AK::Utf32View&)::{lambda()#1}::operator()() const::{lambda<typename... $T0>(($T0&)...)#1}>(Shell::do_escape<, AK::Utf32View>(Shell::Shell::EscapeMode, AK::Utf32View&)::{lambda()#1}::operator()() const::{lambda<typename... $T0>(($T0&)...)#1}&&)Unexecuted instantiation: Shell.cpp:auto AK::Tuple<>::apply_as_args<Shell::do_escape<, AK::Utf8View>(Shell::Shell::EscapeMode, AK::Utf8View&)::{lambda()#1}::operator()() const::{lambda<typename... $T0>(($T0&)...)#1}>(Shell::do_escape<, AK::Utf8View>(Shell::Shell::EscapeMode, AK::Utf8View&)::{lambda()#1}::operator()() const::{lambda<typename... $T0>(($T0&)...)#1}&&)Unexecuted instantiation: Shell.cpp:auto AK::Tuple<>::apply_as_args<Shell::do_escape<, AK::StringView>(Shell::Shell::EscapeMode, AK::StringView&)::{lambda()#1}::operator()() const::{lambda<typename... $T0>(($T0&)...)#1}>(Shell::do_escape<, AK::StringView>(Shell::Shell::EscapeMode, AK::StringView&)::{lambda()#1}::operator()() const::{lambda<typename... $T0>(($T0&)...)#1}&&)Unexecuted instantiation: auto AK::Tuple<char const*>::apply_as_args<Wasm::Validator::Errors::invalid_stack_state<char const*>(Wasm::Validator::Stack const&, AK::Tuple<char const*>, AK::SourceLocation)::{lambda<typename... $T0>(($T0 const&)...)#1}>(Wasm::Validator::Errors::invalid_stack_state<char const*>(Wasm::Validator::Stack const&, AK::Tuple<char const*>, AK::SourceLocation)::{lambda<typename... $T0>(($T0 const&)...)#1}&&) |
196 | | |
197 | | template<typename F> |
198 | | auto apply_as_args(F&& f) const |
199 | | { |
200 | | return apply_as_args(forward<F>(f), Indices()); |
201 | | } |
202 | | |
203 | 0 | static constexpr auto size() { return sizeof...(Ts); } |
204 | | |
205 | | private: |
206 | | template<size_t... Is> |
207 | | Tuple(Tuple&& other, IndexSequence<Is...>) |
208 | 1.18M | : Detail::Tuple<Ts...>(move(other.get<Is>())...) |
209 | 1.18M | { |
210 | 1.18M | } AK::Tuple<unsigned int, IMAP::FetchResponseData>::Tuple<0ul, 1ul>(AK::Tuple<unsigned int, IMAP::FetchResponseData>&&, AK::Detail::IntegerSequence<unsigned long, 0ul, 1ul>) Line | Count | Source | 208 | 847k | : Detail::Tuple<Ts...>(move(other.get<Is>())...) | 209 | 847k | { | 210 | 847k | } |
Unexecuted instantiation: AK::Tuple<IMAP::Envelope, AK::NonnullOwnPtr<IMAP::BodyStructure> >::Tuple<0ul, 1ul>(AK::Tuple<IMAP::Envelope, AK::NonnullOwnPtr<IMAP::BodyStructure> >&&, AK::Detail::IntegerSequence<unsigned long, 0ul, 1ul>) AK::Tuple<IMAP::FetchCommand::DataItem, AK::ByteString>::Tuple<0ul, 1ul>(AK::Tuple<IMAP::FetchCommand::DataItem, AK::ByteString>&&, AK::Detail::IntegerSequence<unsigned long, 0ul, 1ul>) Line | Count | Source | 208 | 310k | : Detail::Tuple<Ts...>(move(other.get<Is>())...) | 209 | 310k | { | 210 | 310k | } |
AK::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >::Tuple<0ul, 1ul>(AK::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >&&, AK::Detail::IntegerSequence<unsigned long, 0ul, 1ul>) Line | Count | Source | 208 | 26.9k | : Detail::Tuple<Ts...>(move(other.get<Is>())...) | 209 | 26.9k | { | 210 | 26.9k | } |
|
211 | | |
212 | | template<size_t... Is> |
213 | | Tuple(Tuple const& other, IndexSequence<Is...>) |
214 | | : Detail::Tuple<Ts...>(other.get<Is>()...) |
215 | | { |
216 | | } |
217 | | |
218 | | template<size_t... Is> |
219 | | void set(Tuple&& other, IndexSequence<Is...>) |
220 | 0 | { |
221 | 0 | ((get<Is>() = move(other.get<Is>())), ...); |
222 | 0 | } Unexecuted instantiation: void AK::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >::set<0ul, 1ul>(AK::Tuple<AK::ByteString, AK::HashMap<AK::ByteString, AK::ByteString, AK::Traits<AK::ByteString>, AK::Traits<AK::ByteString>, false> >&&, AK::Detail::IntegerSequence<unsigned long, 0ul, 1ul>) Unexecuted instantiation: void AK::Tuple<IMAP::Envelope, AK::NonnullOwnPtr<IMAP::BodyStructure> >::set<0ul, 1ul>(AK::Tuple<IMAP::Envelope, AK::NonnullOwnPtr<IMAP::BodyStructure> >&&, AK::Detail::IntegerSequence<unsigned long, 0ul, 1ul>) |
223 | | |
224 | | template<size_t... Is> |
225 | | void set(Tuple const& other, IndexSequence<Is...>) |
226 | | { |
227 | | ((get<Is>() = other.get<Is>()), ...); |
228 | | } |
229 | | |
230 | | template<typename F, size_t... Is> |
231 | | auto apply_as_args(F&& f, IndexSequence<Is...>) |
232 | 0 | { |
233 | 0 | return forward<F>(f)(get<Is>()...); |
234 | 0 | } Unexecuted instantiation: Shell.cpp:auto AK::Tuple<AK::Optional<unsigned long&>, AK::Optional<unsigned long&> >::apply_as_args<Shell::do_escape<unsigned long, unsigned long, AK::ByteString>(Shell::Shell::EscapeMode, AK::ByteString&, unsigned long&, unsigned long&)::{lambda()#1}::operator()() const::{lambda<typename... $T0>(($T0&)...)#1}, 0ul, 1ul>(Shell::do_escape<unsigned long, unsigned long, AK::ByteString>(Shell::Shell::EscapeMode, AK::ByteString&, unsigned long&, unsigned long&)::{lambda()#1}::operator()() const::{lambda<typename... $T0>(($T0&)...)#1}&&, AK::Detail::IntegerSequence<unsigned long, 0ul, 1ul>)Unexecuted instantiation: Shell.cpp:_ZN2AK5TupleIJEE13apply_as_argsIZZN5ShellL9do_escapeIJENS_9Utf32ViewEEENS_10ByteStringENS3_5Shell10EscapeModeERT0_DpRT_ENKUlvE_clEvEUlTpTySD_E_TpTnmJEEEDaOT_NS_6Detail15IntegerSequenceImJXspT0_EEEE Unexecuted instantiation: Shell.cpp:_ZN2AK5TupleIJEE13apply_as_argsIZZN5ShellL9do_escapeIJENS_8Utf8ViewEEENS_10ByteStringENS3_5Shell10EscapeModeERT0_DpRT_ENKUlvE_clEvEUlTpTySD_E_TpTnmJEEEDaOT_NS_6Detail15IntegerSequenceImJXspT0_EEEE Unexecuted instantiation: Shell.cpp:_ZN2AK5TupleIJEE13apply_as_argsIZZN5ShellL9do_escapeIJENS_10StringViewEEENS_10ByteStringENS3_5Shell10EscapeModeERT0_DpRT_ENKUlvE_clEvEUlTpTySD_E_TpTnmJEEEDaOT_NS_6Detail15IntegerSequenceImJXspT0_EEEE Unexecuted instantiation: auto AK::Tuple<char const*>::apply_as_args<Wasm::Validator::Errors::invalid_stack_state<char const*>(Wasm::Validator::Stack const&, AK::Tuple<char const*>, AK::SourceLocation)::{lambda<typename... $T0>(($T0 const&)...)#1}, 0ul>(Wasm::Validator::Errors::invalid_stack_state<char const*>(Wasm::Validator::Stack const&, AK::Tuple<char const*>, AK::SourceLocation)::{lambda<typename... $T0>(($T0 const&)...)#1}&&, AK::Detail::IntegerSequence<unsigned long, 0ul>) |
235 | | |
236 | | template<typename F, size_t... Is> |
237 | | auto apply_as_args(F&& f, IndexSequence<Is...>) const |
238 | | { |
239 | | return forward<F>(f)(get<Is>()...); |
240 | | } |
241 | | }; |
242 | | |
243 | | template<class... Args> |
244 | | Tuple(Args... args) -> Tuple<Args...>; |
245 | | |
246 | | template<size_t I, typename T> |
247 | | struct TupleElement; |
248 | | |
249 | | template<size_t I, typename... Ts> |
250 | | struct TupleElement<I, Tuple<Ts...>> { |
251 | | using Type = TypeListElement<I, typename Tuple<Ts...>::Types>::Type; |
252 | | }; |
253 | | |
254 | | template<typename T> |
255 | | struct TupleSize; |
256 | | |
257 | | template<typename... Ts> |
258 | | struct TupleSize<Tuple<Ts...>> : Detail::IntegralConstant<size_t, sizeof...(Ts)> { }; |
259 | | |
260 | | } |
261 | | |
262 | | namespace std { |
263 | | template<size_t I, typename... Ts> |
264 | | struct tuple_element<I, AK::Tuple<Ts...>> { |
265 | | using type = AK::TupleElement<I, AK::Tuple<Ts...>>::Type; |
266 | | }; |
267 | | |
268 | | template<typename... Ts> |
269 | | struct tuple_size<AK::Tuple<Ts...>> : AK::TupleSize<AK::Tuple<Ts...>> { }; |
270 | | } |
271 | | |
272 | | #if USING_AK_GLOBALLY |
273 | | using AK::Tuple; |
274 | | using AK::TupleElement; |
275 | | using AK::TupleSize; |
276 | | #endif |