diff options
| author | Wladimir J. van der Laan <[email protected]> | 2018-04-10 19:56:22 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2018-04-10 20:54:33 +0200 |
| commit | 0a8054e7cd5c76d01e4ac7234e3883d05f6f5fdd (patch) | |
| tree | ff45a44e6f9bf3a76df3f5f23a80208b550d7a96 /src/script/script.cpp | |
| parent | Merge #12749: [wallet] feebumper: discard change outputs below discard rate (diff) | |
| parent | Support serialization as another type without casting (diff) | |
| download | discoin-0a8054e7cd5c76d01e4ac7234e3883d05f6f5fdd.tar.xz discoin-0a8054e7cd5c76d01e4ac7234e3883d05f6f5fdd.zip | |
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
Diffstat (limited to 'src/script/script.cpp')
0 files changed, 0 insertions, 0 deletions