mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-22 12:49:01 +02:00
Merge #12683: Fix more constness violations in serialization code
172f5fa738Support deserializing into temporaries (Pieter Wuille)2761bca997Merge READWRITEMANY into READWRITE (Pieter Wuille) Pull request description: This is another fragment of improvements from #10785. The current serialization code does not support serializing/deserializing from/to temporaries (like `s >> CFlatData(script)`). As a result, there are many invocations of the `REF` macro which in addition to changing the reference type also changes the constness. This is unnecessary in C++11 as we can use rvalue references now instead. The first commit is an extra simplification we can make that removes the duplication of code between `READWRITE` and `READWRITEMANY` (and related functions). Tree-SHA512: babfa9cb268cc3bc39917e4f0a90e4651c33d85032161e16547a07f3b257b7ca7940e0cbfd69f09439d26fafbb1a6cf6359101043407e2c7aeececf7f20b6eed
This commit is contained in:
@@ -40,7 +40,7 @@ public:
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
TxInputStream& operator>>(T& obj)
|
||||
TxInputStream& operator>>(T&& obj)
|
||||
{
|
||||
::Unserialize(*this, obj);
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user