Skip to content

Commit

Permalink
Reflect all types to make sure it is safe to serialize a type as bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalz800 committed Dec 19, 2021
1 parent 09229c3 commit 50ffbb7
Show file tree
Hide file tree
Showing 3 changed files with 542 additions and 159 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ The above is serializable/deserializable without any modification by using a `me
This has the advantage of better performance most of the times, but the disadvantage is that the format becomes less portable
due to potential padding bytes.

To avoid this behavior and serialize members one by one you can either define the explicit serialization function or
When using plain `zpp::bits::members` it does its best to detect if there is padding for your
type or not and decides this automatically, but to be more explicit, you can either define the explicit serialization function or
use `zpp::bits::explicit_members` and provide the number of members:
```cpp
struct requires_padding
Expand All @@ -239,7 +240,7 @@ struct requires_padding
};
```
If you are using automatic member detection as per `ZPP_BITS_AUTODETECT_MEMBERS_MODE=1`, you may leave the
angle brackets empty as in `zpp::bits::explicit_members<>`.
angle brackets empty as in `zpp::bits::members<>` or `zpp::bits::explicit_members<>`.

* Archives can be constructed from either one of the byte types:
```cpp
Expand Down
Loading

0 comments on commit 50ffbb7

Please sign in to comment.