Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged matching & decode on Boost.Hana serialization #56

Open
vinipsmaker opened this issue Jul 27, 2021 · 0 comments
Open

Merged matching & decode on Boost.Hana serialization #56

vinipsmaker opened this issue Jul 27, 2021 · 0 comments

Comments

@vinipsmaker
Copy link
Contributor

vinipsmaker commented Jul 27, 2021

I know Boost.Hana serialization code wasn't merged yet. The issue is a future TODO item. I'll tackle it myself. And I don't want to keep my mind busy with this information. So I'll just dump the idea here and get back to it at some point in the future.

So I previously suggested the idea to optionally merge matching/decode phases (for string values only): #44 (comment). Once the feature hits the repo, I can update the Boost.Hana serialization code to make use of it.

The idea is: when I hit a member for which a std::string value is desired, branch the algorithm on:

struct_str_member.capacity() == 0

Do not merge matching/decode steps. Perform a separate match to get the literal() size and reserve enough data in one step. Then collect the string.

struct_str_member.capacity() != 0

Trust the user's size estimate heuristic and just merge matching/decode steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant