diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2016-09-12 14:38:01 -0400 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-11-03 13:32:09 -0700 |
commit | b98c14c4e362a8e59d7a3b021651a19ea61b29dd (patch) | |
tree | 372648cea84dd1cfca0d86caab27ac0b18ecc6e2 /src/streams.h | |
parent | 82077ef6e49a08b3772d5c82f6e0cfe390e11966 (diff) |
serialization: teach serializers variadics
Also add a variadic CDataStream ctor for ease-of-use.
Diffstat (limited to 'src/streams.h')
-rw-r--r-- | src/streams.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/streams.h b/src/streams.h index 7132364eb1..fa001c112a 100644 --- a/src/streams.h +++ b/src/streams.h @@ -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; |