Skip to content

Commit 33203f5

Browse files
committed
serialize: specify type for ParamsWrapper not ref
1 parent bf147bf commit 33203f5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/serialize.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,12 +1161,11 @@ class ParamsStream
11611161
template <typename Params, typename T>
11621162
class ParamsWrapper
11631163
{
1164-
static_assert(std::is_lvalue_reference<T>::value, "ParamsWrapper needs an lvalue reference type T");
11651164
const Params& m_params;
1166-
T m_object;
1165+
T& m_object;
11671166

11681167
public:
1169-
explicit ParamsWrapper(const Params& params, T obj) : m_params{params}, m_object{obj} {}
1168+
explicit ParamsWrapper(const Params& params, T& obj) : m_params{params}, m_object{obj} {}
11701169

11711170
template <typename Stream>
11721171
void Serialize(Stream& s) const
@@ -1190,7 +1189,7 @@ class ParamsWrapper
11901189
template <typename Params, typename T>
11911190
static auto WithParams(const Params& params, T&& t)
11921191
{
1193-
return ParamsWrapper<Params, T&>{params, t};
1192+
return ParamsWrapper<Params, T>{params, t};
11941193
}
11951194

11961195
#endif // BITCOIN_SERIALIZE_H

0 commit comments

Comments
 (0)