mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
serialization: teach serializers variadics
Also add a variadic CDataStream ctor for ease-of-use.
This commit is contained in:
committed by
Pieter Wuille
parent
82077ef6e4
commit
b98c14c4e3
@@ -112,6 +112,13 @@ public:
|
||||
Init(nTypeIn, nVersionIn);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
CDataStream(int nTypeIn, int nVersionIn, Args&&... args)
|
||||
{
|
||||
Init(nTypeIn, nVersionIn);
|
||||
::SerializeMany(*this, nType, nVersion, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
void Init(int nTypeIn, int nVersionIn)
|
||||
{
|
||||
nReadPos = 0;
|
||||
|
Reference in New Issue
Block a user