|
|
|
@ -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
|
|
|
|
|