dash/src/primitives
Wladimir J. van der Laan 96e2c5a25f
Merge #12731: Support serialization as another type without casting
818dc74 Support serialization as another type without casting (Pieter Wuille)

Pull request description:

  This adds a `READWRITEAS(type, obj)` macro which serializes `obj` as if it were converted to `const type&` when `const`, and to `type&` when non-`const`. No actual cast is involved, so this only works when this conversion can be done automatically.

  This makes it usable in serialization code that uses a single implementation for both serialization and deserializing, which doesn't know the constness of the object involved.

  This is a redo of #12712, using a slightly different interface.

Tree-SHA512: 262f0257284ff99b5ffaec9b997c194e221522ba35c3ac8eaa9bb344449d7ea0a314de254dc77449fa7aaa600f8cd9a24da65aade8c1ec6aa80c6e9a7bba5ca7
2020-06-11 23:20:48 -05:00
..
block.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
block.h Merge #12731: Support serialization as another type without casting 2020-06-11 23:20:48 -05:00
transaction.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
transaction.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00