From 33203f59b482bddfe0bbe7d497cb8731ce8334a4 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Thu, 14 Sep 2023 10:05:23 +1000 Subject: [PATCH] serialize: specify type for ParamsWrapper not ref --- src/serialize.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/serialize.h b/src/serialize.h index de37fddf292..7e4788a5ca2 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1161,12 +1161,11 @@ public: template class ParamsWrapper { - static_assert(std::is_lvalue_reference::value, "ParamsWrapper needs an lvalue reference type T"); const Params& m_params; - T m_object; + T& m_object; public: - explicit ParamsWrapper(const Params& params, T obj) : m_params{params}, m_object{obj} {} + explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {} template void Serialize(Stream& s) const @@ -1190,7 +1189,7 @@ public: template static auto WithParams(const Params& params, T&& t) { - return ParamsWrapper{params, t}; + return ParamsWrapper{params, t}; } #endif // BITCOIN_SERIALIZE_H