@@ -214,11 +214,11 @@ const Out& AsBase(const In& x)
214
214
* }
215
215
* };
216
216
* which would then be invoked as
217
- * READWRITE(WithParams( BarParameter{...}, Using<FooFormatter>(obj.foo)))
217
+ * READWRITE(BarParameter{...}( Using<FooFormatter>(obj.foo)))
218
218
*
219
219
* parameter(obj) can be invoked anywhere in the call stack; it is
220
220
* passed down recursively into all serialization code, until another
221
- * WithParams overrides it.
221
+ * serialization parameter overrides it.
222
222
*
223
223
* Parameters will be implicitly converted where appropriate. This means that
224
224
* "parent" serialization code can use a parameter that derives from, or is
@@ -1182,17 +1182,6 @@ class ParamsWrapper
1182
1182
}
1183
1183
};
1184
1184
1185
- /* *
1186
- * Return a wrapper around t that (de)serializes it with specified parameter params.
1187
- *
1188
- * See FORMATTER_METHODS_PARAMS for more information on serialization parameters.
1189
- */
1190
- template <typename Params, typename T>
1191
- static auto WithParams (const Params& params, T&& t)
1192
- {
1193
- return ParamsWrapper<Params, T>{params, t};
1194
- }
1195
-
1196
1185
/* *
1197
1186
* Helper macro for SerParams structs
1198
1187
*
@@ -1202,8 +1191,16 @@ static auto WithParams(const Params& params, T&& t)
1202
1191
* constexpr SerParams FOO{....};
1203
1192
* ss << FOO(obj);
1204
1193
*/
1205
- #define SER_PARAMS_OPFUNC \
1206
- template <typename T> \
1207
- auto operator ()(T&& t) const { return WithParams (*this , t); }
1194
+ #define SER_PARAMS_OPFUNC \
1195
+ /* * \
1196
+ * Return a wrapper around t that (de)serializes it with specified parameter params. \
1197
+ * \
1198
+ * See FORMATTER_METHODS_PARAMS for more information on serialization parameters. \
1199
+ */ \
1200
+ template <typename T> \
1201
+ auto operator ()(T&& t) const \
1202
+ { \
1203
+ return ParamsWrapper{*this , t}; \
1204
+ }
1208
1205
1209
1206
#endif // BITCOIN_SERIALIZE_H
0 commit comments