Page MenuHomePhabricator

[backport#17850] Introduce new serialization macros without casts
ClosedPublic

Authored by PiRK on Nov 13 2020, 12:45.

Details

Summary

This new approach uses a static method which takes the object as
a argument. This has the advantage that its constness can be a
template parameter, allowing a single implementation that sees the
object as const for serialization and non-const for deserialization,
without casts.

More boilerplate is included in the new macro as well.

This is a backport of Core PR17850 [1/2]
Commit https://github.com/bitcoin/bitcoin/pull/17850/commits/ca33451535dc29f64d37c49af8b22142d7716d0d

Test Plan

ninja

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable