mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
serialize: add SER_PARAMS_OPFUNC
This commit is contained in:
@@ -1192,4 +1192,17 @@ static auto WithParams(const Params& params, T&& t)
|
||||
return ParamsWrapper<Params, T>{params, t};
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper macro for SerParams structs
|
||||
*
|
||||
* Allows you define SerParams instances and then apply them directly
|
||||
* to an object via function call syntax, eg:
|
||||
*
|
||||
* constexpr SerParams FOO{....};
|
||||
* ss << FOO(obj);
|
||||
*/
|
||||
#define SER_PARAMS_OPFUNC \
|
||||
template <typename T> \
|
||||
auto operator()(T&& t) const { return WithParams(*this, t); }
|
||||
|
||||
#endif // BITCOIN_SERIALIZE_H
|
||||
|
||||
Reference in New Issue
Block a user