You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In protopuf, uint32_field<name, key> is an alias for varint_field<name, key, uint32_t>, and varint_field<name, key, T> is an alias for field<name, key, varint_coder<T>>.
So actually, we divide the data type T and the encoding type *_coder<T>. While you want a uint32_t with varint encoding (refer to protobuf docs and wikipedia), you can use uint32_field (same as uint32 in protobuf), and while you want a uint32_t with fixed length encoding, you can use fixed32_field (alias to integer_field<name, key, uint32_t> and field<name, key, integer_coder<uint32_t>>, same as fixed32 in protobuf).
This design enables flexible combination of data types and encoding methods, and is an important abstraction in protopuf.
Or another possible way with boost::pfr?
This is a great suggestion, and I will go and study its feasibility further.
Let me know if you have any implementation suggestions, issues and PRs are very welcome!
Hi,
Is it possible to improve as such?
Or another possible way with boost::pfr?
The text was updated successfully, but these errors were encountered: