diff options
author | Anthony Towns <aj@erisian.com.au> | 2023-09-14 10:05:23 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2023-09-14 10:25:20 +1000 |
commit | 33203f59b482bddfe0bbe7d497cb8731ce8334a4 (patch) | |
tree | fc84a17102e722b4ba370ed548ce541d52cb13e9 /src | |
parent | bf147bfffa1afb11721f30e83eec1fa829f64d5f (diff) |
serialize: specify type for ParamsWrapper not ref
Diffstat (limited to 'src')
-rw-r--r-- | src/serialize.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/serialize.h b/src/serialize.h index de37fddf29..7e4788a5ca 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1161,12 +1161,11 @@ public: template <typename Params, typename T> class ParamsWrapper { - static_assert(std::is_lvalue_reference<T>::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 <typename Stream> void Serialize(Stream& s) const @@ -1190,7 +1189,7 @@ public: template <typename Params, typename T> static auto WithParams(const Params& params, T&& t) { - return ParamsWrapper<Params, T&>{params, t}; + return ParamsWrapper<Params, T>{params, t}; } #endif // BITCOIN_SERIALIZE_H |