serialization: teach serializers variadics

Also add a variadic CDataStream ctor for ease-of-use.
This commit is contained in:
Cory Fields
2016-09-12 14:38:01 -04:00
committed by Pieter Wuille
parent 82077ef6e4
commit b98c14c4e3
3 changed files with 126 additions and 1 deletions

View File

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