zpp_bits v4.7.7
Permanent link:
cppdashboard.dev/r/2026/11/zpp-bits-v4-7-7A lightweight C++20 serialization and RPC library
Release notes
BREAKING CHANGE: Empty types are no longer byte serializable
Empty types (e.g. struct {}) are no longer considered byte serializable.
Although an empty type has no data, its sizeof is typically 1, meaning its object representation contains a byte that is effectively padding. This byte was never intended to be serialized. In most cases, empty types were already serialized as zero bytes. However, when a containing type qualified for byte serialization, the library optimized serialization to a memcpy, inadvertently including this otherwise uninitialized byte.
Besides changing the serialization format, this could expose uninitialized memory in the serialized output.
Empty types are now explicitly excluded from byte serialization and are handled through regular member-wise serialization, which correctly serializes them as zero bytes.
We are confident in making this breaking change because serializing the padding byte of an empty type has no meaningful use case. Preserving compatibility would mean retaining behavior that is both undesirable from a security perspective and inconsistent with the intended serialization semantics.
Compatibility impact: The serialized representation changes for types affected by this optimization:
• std::vector<Empty> now serializes only its size prefix, without the additional byte previously emitted for each element.
• Structs containing empty members (including arrays of empty types) may no longer qualify for memcpy serialization. Their members are serialized individually instead.
Serialized data produced by previous versions may not be compatible with the new encoding for affected types. Share this resource