COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
variant_access.h
1//
2// Copyright 2017 - 2024 (C). Alex Robenko. All rights reserved.
3//
4// This Source Code Form is subject to the terms of the Mozilla Public
5// License, v. 2.0. If a copy of the MPL was not distributed with this
6// file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
8#pragma once
9
10#include <tuple>
11#include <type_traits>
12
13#include "macro_common.h"
14#include "gen_enum.h"
15#include "base_detection.h"
16
17#ifdef COMMS_MUST_DEFINE_BASE
18#define COMMS_AS_VARIANT_FUNC Base& asVariant()
19#define COMMS_AS_VARIANT_CONST_FUNC const Base& asVariant() const
20#define COMMS_VARIANT_INIT_FIELD_FUNC(v_, n_) \
21 typename std::tuple_element<COMMS_CONCATENATE(FieldIdx_, n_), typename Base::Members>::type& COMMS_CONCATENATE(initField_, n_)(TArgs&&... args)
22#define COMMS_VARIANT_ACCESS_FIELD_FUNC(v_, n_) \
23 typename std::tuple_element<COMMS_CONCATENATE(FieldIdx_, n_), typename Base::Members>::type& COMMS_CONCATENATE(accessField_, n_)()
24#define COMMS_VARIANT_ACCESS_FIELD_CONST_FUNC(v_, n_) \
25 const typename std::tuple_element<COMMS_CONCATENATE(FieldIdx_, n_), typename Base::Members>::type& COMMS_CONCATENATE(accessField_, n_)() const
26
27#else // #ifdef COMMS_MUST_DEFINE_BASE
28#define COMMS_AS_VARIANT_FUNC FUNC_AUTO_REF_RETURN(asVariant, decltype(comms::field::toFieldBase(*this)))
29#define COMMS_AS_VARIANT_CONST_FUNC FUNC_AUTO_REF_RETURN_CONST(asVariant, decltype(comms::field::toFieldBase(*this)))
30#define COMMS_VARIANT_INIT_FIELD_FUNC(v_, n_) \
31 FUNC_ARGS_AUTO_REF_RETURN(COMMS_CONCATENATE(initField_, n_), TArgs&&... args, decltype(v_.template initField<COMMS_CONCATENATE(FieldIdx_, n_)>(std::forward<TArgs>(args)...)))
32#define COMMS_VARIANT_ACCESS_FIELD_FUNC(v_, n_) \
33 FUNC_AUTO_REF_RETURN(COMMS_CONCATENATE(accessField_, n_), decltype(v_.template accessField<COMMS_CONCATENATE(FieldIdx_, n_)>()))
34#define COMMS_VARIANT_ACCESS_FIELD_CONST_FUNC(v_, n_) \
35 FUNC_AUTO_REF_RETURN_CONST(COMMS_CONCATENATE(accessField_, n_), decltype(v_.template accessField<COMMS_CONCATENATE(FieldIdx_, n_)>()))
36#endif // #ifdef COMMS_MUST_DEFINE_BASE
37
38#define COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
39 template <typename... TArgs> \
40 COMMS_VARIANT_INIT_FIELD_FUNC(v_, n_) {\
41 return v_.template initField<COMMS_CONCATENATE(FieldIdx_, n_)>(std::forward<TArgs>(args)...); \
42 } \
43 void COMMS_CONCATENATE(deinitField_, n_)() {\
44 v_.template deinitField<COMMS_CONCATENATE(FieldIdx_, n_)>(); \
45 } \
46 COMMS_VARIANT_ACCESS_FIELD_FUNC(v_, n_) { \
47 return v_.template accessField<COMMS_CONCATENATE(FieldIdx_, n_)>(); \
48 } \
49 COMMS_VARIANT_ACCESS_FIELD_CONST_FUNC(v_, n_) { \
50 return v_.template accessField<COMMS_CONCATENATE(FieldIdx_, n_)>(); \
51 }
52
53#define COMMS_VARIANT_MEM_ACC_FUNC_1(v_, n_) COMMS_VARIANT_MEM_ACC_FUNC(v_, n_)
54#define COMMS_VARIANT_MEM_ACC_FUNC_2(v_, n_, ...) \
55 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
56 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_1(v_, __VA_ARGS__))
57#define COMMS_VARIANT_MEM_ACC_FUNC_3(v_, n_, ...) \
58 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
59 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_2(v_, __VA_ARGS__))
60#define COMMS_VARIANT_MEM_ACC_FUNC_4(v_, n_, ...) \
61 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
62 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_3(v_, __VA_ARGS__))
63#define COMMS_VARIANT_MEM_ACC_FUNC_5(v_, n_, ...) \
64 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
65 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_4(v_, __VA_ARGS__))
66#define COMMS_VARIANT_MEM_ACC_FUNC_6(v_, n_, ...) \
67 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
68 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_5(v_, __VA_ARGS__))
69#define COMMS_VARIANT_MEM_ACC_FUNC_7(v_, n_, ...) \
70 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
71 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_6(v_, __VA_ARGS__))
72#define COMMS_VARIANT_MEM_ACC_FUNC_8(v_, n_, ...) \
73 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
74 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_7(v_, __VA_ARGS__))
75#define COMMS_VARIANT_MEM_ACC_FUNC_9(v_, n_, ...) \
76 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
77 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_8(v_, __VA_ARGS__))
78#define COMMS_VARIANT_MEM_ACC_FUNC_10(v_, n_, ...) \
79 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
80 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_9(v_, __VA_ARGS__))
81#define COMMS_VARIANT_MEM_ACC_FUNC_11(v_, n_, ...) \
82 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
83 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_10(v_, __VA_ARGS__))
84#define COMMS_VARIANT_MEM_ACC_FUNC_12(v_, n_, ...) \
85 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
86 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_11(v_, __VA_ARGS__))
87#define COMMS_VARIANT_MEM_ACC_FUNC_13(v_, n_, ...) \
88 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
89 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_12(v_, __VA_ARGS__))
90#define COMMS_VARIANT_MEM_ACC_FUNC_14(v_, n_, ...) \
91 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
92 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_13(v_, __VA_ARGS__))
93#define COMMS_VARIANT_MEM_ACC_FUNC_15(v_, n_, ...) \
94 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
95 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_14(v_, __VA_ARGS__))
96#define COMMS_VARIANT_MEM_ACC_FUNC_16(v_, n_, ...) \
97 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
98 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_15(v_, __VA_ARGS__))
99#define COMMS_VARIANT_MEM_ACC_FUNC_17(v_, n_, ...) \
100 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
101 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_16(v_, __VA_ARGS__))
102#define COMMS_VARIANT_MEM_ACC_FUNC_18(v_, n_, ...) \
103 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
104 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_17(v_, __VA_ARGS__))
105#define COMMS_VARIANT_MEM_ACC_FUNC_19(v_, n_, ...) \
106 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
107 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_18(v_, __VA_ARGS__))
108#define COMMS_VARIANT_MEM_ACC_FUNC_20(v_, n_, ...) \
109 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
110 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_19(v_, __VA_ARGS__))
111#define COMMS_VARIANT_MEM_ACC_FUNC_21(v_, n_, ...) \
112 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
113 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_20(v_, __VA_ARGS__))
114#define COMMS_VARIANT_MEM_ACC_FUNC_22(v_, n_, ...) \
115 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
116 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_21(v_, __VA_ARGS__))
117#define COMMS_VARIANT_MEM_ACC_FUNC_23(v_, n_, ...) \
118 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
119 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_22(v_, __VA_ARGS__))
120#define COMMS_VARIANT_MEM_ACC_FUNC_24(v_, n_, ...) \
121 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
122 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_23(v_, __VA_ARGS__))
123#define COMMS_VARIANT_MEM_ACC_FUNC_25(v_, n_, ...) \
124 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
125 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_24(v_, __VA_ARGS__))
126#define COMMS_VARIANT_MEM_ACC_FUNC_26(v_, n_, ...) \
127 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
128 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_25(v_, __VA_ARGS__))
129#define COMMS_VARIANT_MEM_ACC_FUNC_27(v_, n_, ...) \
130 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
131 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_26(v_, __VA_ARGS__))
132#define COMMS_VARIANT_MEM_ACC_FUNC_28(v_, n_, ...) \
133 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
134 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_27(v_, __VA_ARGS__))
135#define COMMS_VARIANT_MEM_ACC_FUNC_29(v_, n_, ...) \
136 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
137 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_28(v_, __VA_ARGS__))
138#define COMMS_VARIANT_MEM_ACC_FUNC_30(v_, n_, ...) \
139 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
140 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_29(v_, __VA_ARGS__))
141#define COMMS_VARIANT_MEM_ACC_FUNC_31(v_, n_, ...) \
142 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
143 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_30(v_, __VA_ARGS__))
144#define COMMS_VARIANT_MEM_ACC_FUNC_32(v_, n_, ...) \
145 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
146 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_31(v_, __VA_ARGS__))
147#define COMMS_VARIANT_MEM_ACC_FUNC_33(v_, n_, ...) \
148 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
149 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_32(v_, __VA_ARGS__))
150#define COMMS_VARIANT_MEM_ACC_FUNC_34(v_, n_, ...) \
151 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
152 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_33(v_, __VA_ARGS__))
153#define COMMS_VARIANT_MEM_ACC_FUNC_35(v_, n_, ...) \
154 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
155 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_34(v_, __VA_ARGS__))
156#define COMMS_VARIANT_MEM_ACC_FUNC_36(v_, n_, ...) \
157 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
158 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_35(v_, __VA_ARGS__))
159#define COMMS_VARIANT_MEM_ACC_FUNC_37(v_, n_, ...) \
160 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
161 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_36(v_, __VA_ARGS__))
162#define COMMS_VARIANT_MEM_ACC_FUNC_38(v_, n_, ...) \
163 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
164 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_37(v_, __VA_ARGS__))
165#define COMMS_VARIANT_MEM_ACC_FUNC_39(v_, n_, ...) \
166 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
167 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_38(v_, __VA_ARGS__))
168#define COMMS_VARIANT_MEM_ACC_FUNC_40(v_, n_, ...) \
169 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
170 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_39(v_, __VA_ARGS__))
171#define COMMS_VARIANT_MEM_ACC_FUNC_41(v_, n_, ...) \
172 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
173 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_40(v_, __VA_ARGS__))
174#define COMMS_VARIANT_MEM_ACC_FUNC_42(v_, n_, ...) \
175 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
176 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_41(v_, __VA_ARGS__))
177#define COMMS_VARIANT_MEM_ACC_FUNC_43(v_, n_, ...) \
178 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
179 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_42(v_, __VA_ARGS__))
180#define COMMS_VARIANT_MEM_ACC_FUNC_44(v_, n_, ...) \
181 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
182 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_43(v_, __VA_ARGS__))
183#define COMMS_VARIANT_MEM_ACC_FUNC_45(v_, n_, ...) \
184 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
185 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_44(v_, __VA_ARGS__))
186#define COMMS_VARIANT_MEM_ACC_FUNC_46(v_, n_, ...) \
187 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
188 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_45(v_, __VA_ARGS__))
189#define COMMS_VARIANT_MEM_ACC_FUNC_47(v_, n_, ...) \
190 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
191 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_46(v_, __VA_ARGS__))
192#define COMMS_VARIANT_MEM_ACC_FUNC_48(v_, n_, ...) \
193 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
194 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_47(v_, __VA_ARGS__))
195#define COMMS_VARIANT_MEM_ACC_FUNC_49(v_, n_, ...) \
196 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
197 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_48(v_, __VA_ARGS__))
198#define COMMS_VARIANT_MEM_ACC_FUNC_50(v_, n_, ...) \
199 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
200 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_49(v_, __VA_ARGS__))
201#define COMMS_VARIANT_MEM_ACC_FUNC_51(v_, n_, ...) \
202 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
203 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_50(v_, __VA_ARGS__))
204#define COMMS_VARIANT_MEM_ACC_FUNC_52(v_, n_, ...) \
205 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
206 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_51(v_, __VA_ARGS__))
207#define COMMS_VARIANT_MEM_ACC_FUNC_53(v_, n_, ...) \
208 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
209 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_52(v_, __VA_ARGS__))
210#define COMMS_VARIANT_MEM_ACC_FUNC_54(v_, n_, ...) \
211 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
212 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_53(v_, __VA_ARGS__))
213#define COMMS_VARIANT_MEM_ACC_FUNC_55(v_, n_, ...) \
214 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
215 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_54(v_, __VA_ARGS__))
216#define COMMS_VARIANT_MEM_ACC_FUNC_56(v_, n_, ...) \
217 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
218 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_55(v_, __VA_ARGS__))
219#define COMMS_VARIANT_MEM_ACC_FUNC_57(v_, n_, ...) \
220 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
221 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_56(v_, __VA_ARGS__))
222#define COMMS_VARIANT_MEM_ACC_FUNC_58(v_, n_, ...) \
223 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
224 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_57(v_, __VA_ARGS__))
225#define COMMS_VARIANT_MEM_ACC_FUNC_59(v_, n_, ...) \
226 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
227 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_58(v_, __VA_ARGS__))
228#define COMMS_VARIANT_MEM_ACC_FUNC_60(v_, n_, ...) \
229 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
230 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_59(v_, __VA_ARGS__))
231#define COMMS_VARIANT_MEM_ACC_FUNC_61(v_, n_, ...) \
232 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
233 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_60(v_, __VA_ARGS__))
234#define COMMS_VARIANT_MEM_ACC_FUNC_62(v_, n_, ...) \
235 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
236 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_61(v_, __VA_ARGS__))
237#define COMMS_VARIANT_MEM_ACC_FUNC_63(v_, n_, ...) \
238 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
239 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_62(v_, __VA_ARGS__))
240#define COMMS_VARIANT_MEM_ACC_FUNC_64(v_, n_, ...) \
241 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
242 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_63(v_, __VA_ARGS__))
243#define COMMS_VARIANT_MEM_ACC_FUNC_65(v_, n_, ...) \
244 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
245 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_64(v_, __VA_ARGS__))
246#define COMMS_VARIANT_MEM_ACC_FUNC_66(v_, n_, ...) \
247 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
248 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_65(v_, __VA_ARGS__))
249#define COMMS_VARIANT_MEM_ACC_FUNC_67(v_, n_, ...) \
250 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
251 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_66(v_, __VA_ARGS__))
252#define COMMS_VARIANT_MEM_ACC_FUNC_68(v_, n_, ...) \
253 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
254 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_67(v_, __VA_ARGS__))
255#define COMMS_VARIANT_MEM_ACC_FUNC_69(v_, n_, ...) \
256 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
257 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_68(v_, __VA_ARGS__))
258#define COMMS_VARIANT_MEM_ACC_FUNC_70(v_, n_, ...) \
259 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
260 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_69(v_, __VA_ARGS__))
261#define COMMS_VARIANT_MEM_ACC_FUNC_71(v_, n_, ...) \
262 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
263 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_70(v_, __VA_ARGS__))
264#define COMMS_VARIANT_MEM_ACC_FUNC_72(v_, n_, ...) \
265 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
266 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_71(v_, __VA_ARGS__))
267#define COMMS_VARIANT_MEM_ACC_FUNC_73(v_, n_, ...) \
268 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
269 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_72(v_, __VA_ARGS__))
270#define COMMS_VARIANT_MEM_ACC_FUNC_74(v_, n_, ...) \
271 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
272 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_73(v_, __VA_ARGS__))
273#define COMMS_VARIANT_MEM_ACC_FUNC_75(v_, n_, ...) \
274 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
275 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_74(v_, __VA_ARGS__))
276#define COMMS_VARIANT_MEM_ACC_FUNC_76(v_, n_, ...) \
277 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
278 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_75(v_, __VA_ARGS__))
279#define COMMS_VARIANT_MEM_ACC_FUNC_77(v_, n_, ...) \
280 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
281 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_76(v_, __VA_ARGS__))
282#define COMMS_VARIANT_MEM_ACC_FUNC_78(v_, n_, ...) \
283 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
284 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_77(v_, __VA_ARGS__))
285#define COMMS_VARIANT_MEM_ACC_FUNC_79(v_, n_, ...) \
286 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
287 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_78(v_, __VA_ARGS__))
288#define COMMS_VARIANT_MEM_ACC_FUNC_80(v_, n_, ...) \
289 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
290 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_79(v_, __VA_ARGS__))
291#define COMMS_VARIANT_MEM_ACC_FUNC_81(v_, n_, ...) \
292 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
293 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_80(v_, __VA_ARGS__))
294#define COMMS_VARIANT_MEM_ACC_FUNC_82(v_, n_, ...) \
295 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
296 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_81(v_, __VA_ARGS__))
297#define COMMS_VARIANT_MEM_ACC_FUNC_83(v_, n_, ...) \
298 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
299 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_82(v_, __VA_ARGS__))
300#define COMMS_VARIANT_MEM_ACC_FUNC_84(v_, n_, ...) \
301 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
302 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_83(v_, __VA_ARGS__))
303#define COMMS_VARIANT_MEM_ACC_FUNC_85(v_, n_, ...) \
304 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
305 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_84(v_, __VA_ARGS__))
306#define COMMS_VARIANT_MEM_ACC_FUNC_86(v_, n_, ...) \
307 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
308 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_85(v_, __VA_ARGS__))
309#define COMMS_VARIANT_MEM_ACC_FUNC_87(v_, n_, ...) \
310 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
311 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_86(v_, __VA_ARGS__))
312#define COMMS_VARIANT_MEM_ACC_FUNC_88(v_, n_, ...) \
313 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
314 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_87(v_, __VA_ARGS__))
315#define COMMS_VARIANT_MEM_ACC_FUNC_89(v_, n_, ...) \
316 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
317 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_88(v_, __VA_ARGS__))
318#define COMMS_VARIANT_MEM_ACC_FUNC_90(v_, n_, ...) \
319 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
320 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_89(v_, __VA_ARGS__))
321#define COMMS_VARIANT_MEM_ACC_FUNC_91(v_, n_, ...) \
322 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
323 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_90(v_, __VA_ARGS__))
324#define COMMS_VARIANT_MEM_ACC_FUNC_92(v_, n_, ...) \
325 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
326 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_91(v_, __VA_ARGS__))
327#define COMMS_VARIANT_MEM_ACC_FUNC_93(v_, n_, ...) \
328 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
329 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_92(v_, __VA_ARGS__))
330#define COMMS_VARIANT_MEM_ACC_FUNC_94(v_, n_, ...) \
331 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
332 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_93(v_, __VA_ARGS__))
333#define COMMS_VARIANT_MEM_ACC_FUNC_95(v_, n_, ...) \
334 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
335 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_94(v_, __VA_ARGS__))
336#define COMMS_VARIANT_MEM_ACC_FUNC_96(v_, n_, ...) \
337 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
338 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_95(v_, __VA_ARGS__))
339#define COMMS_VARIANT_MEM_ACC_FUNC_97(v_, n_, ...) \
340 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
341 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_96(v_, __VA_ARGS__))
342#define COMMS_VARIANT_MEM_ACC_FUNC_98(v_, n_, ...) \
343 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
344 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_97(v_, __VA_ARGS__))
345#define COMMS_VARIANT_MEM_ACC_FUNC_99(v_, n_, ...) \
346 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
347 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_98(v_, __VA_ARGS__))
348#define COMMS_VARIANT_MEM_ACC_FUNC_100(v_, n_, ...) \
349 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
350 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_99(v_, __VA_ARGS__))
351#define COMMS_VARIANT_MEM_ACC_FUNC_101(v_, n_, ...) \
352 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
353 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_100(v_, __VA_ARGS__))
354#define COMMS_VARIANT_MEM_ACC_FUNC_102(v_, n_, ...) \
355 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
356 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_101(v_, __VA_ARGS__))
357#define COMMS_VARIANT_MEM_ACC_FUNC_103(v_, n_, ...) \
358 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
359 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_102(v_, __VA_ARGS__))
360#define COMMS_VARIANT_MEM_ACC_FUNC_104(v_, n_, ...) \
361 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
362 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_103(v_, __VA_ARGS__))
363#define COMMS_VARIANT_MEM_ACC_FUNC_105(v_, n_, ...) \
364 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
365 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_104(v_, __VA_ARGS__))
366#define COMMS_VARIANT_MEM_ACC_FUNC_106(v_, n_, ...) \
367 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
368 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_105(v_, __VA_ARGS__))
369#define COMMS_VARIANT_MEM_ACC_FUNC_107(v_, n_, ...) \
370 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
371 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_106(v_, __VA_ARGS__))
372#define COMMS_VARIANT_MEM_ACC_FUNC_108(v_, n_, ...) \
373 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
374 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_107(v_, __VA_ARGS__))
375#define COMMS_VARIANT_MEM_ACC_FUNC_109(v_, n_, ...) \
376 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
377 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_108(v_, __VA_ARGS__))
378#define COMMS_VARIANT_MEM_ACC_FUNC_110(v_, n_, ...) \
379 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
380 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_109(v_, __VA_ARGS__))
381#define COMMS_VARIANT_MEM_ACC_FUNC_111(v_, n_, ...) \
382 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
383 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_110(v_, __VA_ARGS__))
384#define COMMS_VARIANT_MEM_ACC_FUNC_112(v_, n_, ...) \
385 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
386 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_111(v_, __VA_ARGS__))
387#define COMMS_VARIANT_MEM_ACC_FUNC_113(v_, n_, ...) \
388 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
389 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_112(v_, __VA_ARGS__))
390#define COMMS_VARIANT_MEM_ACC_FUNC_114(v_, n_, ...) \
391 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
392 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_113(v_, __VA_ARGS__))
393#define COMMS_VARIANT_MEM_ACC_FUNC_115(v_, n_, ...) \
394 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
395 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_114(v_, __VA_ARGS__))
396#define COMMS_VARIANT_MEM_ACC_FUNC_116(v_, n_, ...) \
397 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
398 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_115(v_, __VA_ARGS__))
399#define COMMS_VARIANT_MEM_ACC_FUNC_117(v_, n_, ...) \
400 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
401 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_116(v_, __VA_ARGS__))
402#define COMMS_VARIANT_MEM_ACC_FUNC_118(v_, n_, ...) \
403 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
404 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_117(v_, __VA_ARGS__))
405#define COMMS_VARIANT_MEM_ACC_FUNC_119(v_, n_, ...) \
406 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
407 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_118(v_, __VA_ARGS__))
408#define COMMS_VARIANT_MEM_ACC_FUNC_120(v_, n_, ...) \
409 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
410 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_119(v_, __VA_ARGS__))
411#define COMMS_VARIANT_MEM_ACC_FUNC_121(v_, n_, ...) \
412 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
413 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_120(v_, __VA_ARGS__))
414#define COMMS_VARIANT_MEM_ACC_FUNC_122(v_, n_, ...) \
415 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
416 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_121(v_, __VA_ARGS__))
417#define COMMS_VARIANT_MEM_ACC_FUNC_123(v_, n_, ...) \
418 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
419 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_122(v_, __VA_ARGS__))
420#define COMMS_VARIANT_MEM_ACC_FUNC_124(v_, n_, ...) \
421 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
422 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_123(v_, __VA_ARGS__))
423#define COMMS_VARIANT_MEM_ACC_FUNC_125(v_, n_, ...) \
424 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
425 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_124(v_, __VA_ARGS__))
426#define COMMS_VARIANT_MEM_ACC_FUNC_126(v_, n_, ...) \
427 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
428 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_125(v_, __VA_ARGS__))
429#define COMMS_VARIANT_MEM_ACC_FUNC_127(v_, n_, ...) \
430 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
431 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_126(v_, __VA_ARGS__))
432#define COMMS_VARIANT_MEM_ACC_FUNC_128(v_, n_, ...) \
433 COMMS_VARIANT_MEM_ACC_FUNC(v_, n_) \
434 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_127(v_, __VA_ARGS__))
435
436#define COMMS_CHOOSE_VARIANT_MEM_ACC_FUNC_(N, v_, ...) COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_ ## N(v_, __VA_ARGS__))
437#define COMMS_CHOOSE_VARIANT_MEM_ACC_FUNC(N, v_, ...) COMMS_EXPAND(COMMS_CHOOSE_VARIANT_MEM_ACC_FUNC_(N, v_, __VA_ARGS__))
438#define COMMS_DO_VARIANT_MEM_ACC_FUNC(v_, ...) \
439 COMMS_EXPAND(COMMS_CHOOSE_VARIANT_MEM_ACC_FUNC(COMMS_NUM_ARGS(__VA_ARGS__), v_, __VA_ARGS__))
440
441// --------------------------------------------
442
443#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
444 template <typename... TArgs> \
445 typename std::tuple_element<COMMS_CONCATENATE(FieldIdx_, n_), Members>::type& COMMS_CONCATENATE(initField_, n_)(TArgs&&... args) {\
446 return initField<COMMS_CONCATENATE(FieldIdx_, n_)>(std::forward<TArgs>(args)...); \
447 } \
448 typename std::tuple_element<COMMS_CONCATENATE(FieldIdx_, n_), Members>::type& COMMS_CONCATENATE(accessField_, n_)() { \
449 return accessField<COMMS_CONCATENATE(FieldIdx_, n_)>(); \
450 } \
451 const typename std::tuple_element<COMMS_CONCATENATE(FieldIdx_, n_), Members>::type& COMMS_CONCATENATE(accessField_, n_)() const { \
452 return accessField<COMMS_CONCATENATE(FieldIdx_, n_)>(); \
453 }
454
455#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_1(n_) COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_)
456#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_2(n_, ...) \
457 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
458 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_1(__VA_ARGS__))
459#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_3(n_, ...) \
460 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
461 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_2(__VA_ARGS__))
462#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_4(n_, ...) \
463 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
464 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_3(__VA_ARGS__))
465#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_5(n_, ...) \
466 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
467 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_4(__VA_ARGS__))
468#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_6(n_, ...) \
469 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
470 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_5(__VA_ARGS__))
471#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_7(n_, ...) \
472 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
473 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_6(__VA_ARGS__))
474#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_8(n_, ...) \
475 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
476 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_7(__VA_ARGS__))
477#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_9(n_, ...) \
478 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
479 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_8(__VA_ARGS__))
480#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_10(n_, ...) \
481 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
482 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_9(__VA_ARGS__))
483#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_11(n_, ...) \
484 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
485 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_10(__VA_ARGS__))
486#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_12(n_, ...) \
487 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
488 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_11(__VA_ARGS__))
489#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_13(n_, ...) \
490 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
491 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_12(__VA_ARGS__))
492#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_14(n_, ...) \
493 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
494 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_13(__VA_ARGS__))
495#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_15(n_, ...) \
496 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
497 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_14(__VA_ARGS__))
498#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_16(n_, ...) \
499 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
500 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_15(__VA_ARGS__))
501#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_17(n_, ...) \
502 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
503 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_16(__VA_ARGS__))
504#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_18(n_, ...) \
505 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
506 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_17(__VA_ARGS__))
507#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_19(n_, ...) \
508 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
509 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_18(__VA_ARGS__))
510#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_20(n_, ...) \
511 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
512 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_19(__VA_ARGS__))
513#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_21(n_, ...) \
514 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
515 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_20(__VA_ARGS__))
516#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_22(n_, ...) \
517 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
518 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_21(__VA_ARGS__))
519#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_23(n_, ...) \
520 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
521 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_22(__VA_ARGS__))
522#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_24(n_, ...) \
523 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
524 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_23(__VA_ARGS__))
525#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_25(n_, ...) \
526 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
527 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_24(__VA_ARGS__))
528#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_26(n_, ...) \
529 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
530 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_25(__VA_ARGS__))
531#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_27(n_, ...) \
532 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
533 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_26(__VA_ARGS__))
534#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_28(n_, ...) \
535 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
536 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_27(__VA_ARGS__))
537#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_29(n_, ...) \
538 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
539 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_28(__VA_ARGS__))
540#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_30(n_, ...) \
541 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
542 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_29(__VA_ARGS__))
543#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_31(n_, ...) \
544 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
545 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_30(__VA_ARGS__))
546#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_32(n_, ...) \
547 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
548 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_31(__VA_ARGS__))
549#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_33(n_, ...) \
550 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
551 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_32(__VA_ARGS__))
552#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_34(n_, ...) \
553 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
554 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_33(__VA_ARGS__))
555#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_35(n_, ...) \
556 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
557 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_34(__VA_ARGS__))
558#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_36(n_, ...) \
559 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
560 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_35(__VA_ARGS__))
561#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_37(n_, ...) \
562 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
563 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_36(__VA_ARGS__))
564#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_38(n_, ...) \
565 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
566 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_37(__VA_ARGS__))
567#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_39(n_, ...) \
568 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
569 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_38(__VA_ARGS__))
570#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_40(n_, ...) \
571 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
572 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_39(__VA_ARGS__))
573#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_41(n_, ...) \
574 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
575 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_40(__VA_ARGS__))
576#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_42(n_, ...) \
577 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
578 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_41(__VA_ARGS__))
579#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_43(n_, ...) \
580 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
581 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_42(__VA_ARGS__))
582#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_44(n_, ...) \
583 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
584 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_43(__VA_ARGS__))
585#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_45(n_, ...) \
586 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
587 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_44(__VA_ARGS__))
588#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_46(n_, ...) \
589 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
590 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_45(__VA_ARGS__))
591#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_47(n_, ...) \
592 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
593 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_46(__VA_ARGS__))
594#define COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_48(n_, ...) \
595 COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(n_) \
596 COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_47(__VA_ARGS__))
597
598#define COMMS_CHOOSE_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_(N, ...) COMMS_EXPAND(COMMS_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_ ## N(__VA_ARGS__))
599#define COMMS_CHOOSE_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(N, ...) COMMS_EXPAND(COMMS_CHOOSE_VARIANT_MEM_ACC_FUNC_NOTEMPLATE_(N, __VA_ARGS__))
600#define COMMS_DO_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(...) \
601 COMMS_EXPAND(COMMS_CHOOSE_VARIANT_MEM_ACC_FUNC_NOTEMPLATE(COMMS_NUM_ARGS(__VA_ARGS__), __VA_ARGS__))
602
603
604
605
606
607
608
609
610
611
612