@@ -214,11 +214,11 @@ const Out& AsBase(const In& x)
214214 * }
215215 * };
216216 * which would then be invoked as
217- * READWRITE(WithParams( BarParameter{...}, Using<FooFormatter>(obj.foo)))
217+ * READWRITE(BarParameter{...}( Using<FooFormatter>(obj.foo)))
218218 *
219219 * parameter(obj) can be invoked anywhere in the call stack; it is
220220 * passed down recursively into all serialization code, until another
221- * WithParams overrides it.
221+ * serialization parameter overrides it.
222222 *
223223 * Parameters will be implicitly converted where appropriate. This means that
224224 * "parent" serialization code can use a parameter that derives from, or is
@@ -1182,17 +1182,6 @@ class ParamsWrapper
11821182 }
11831183};
11841184
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-
11961185/* *
11971186 * Helper macro for SerParams structs
11981187 *
@@ -1202,8 +1191,16 @@ static auto WithParams(const Params& params, T&& t)
12021191 * constexpr SerParams FOO{....};
12031192 * ss << FOO(obj);
12041193 */
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+ }
12081205
12091206#endif // BITCOIN_SERIALIZE_H
0 commit comments