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.
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::stringvalue is desired, branch the algorithm on:struct_str_member.capacity() == 0Do 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() != 0Trust the user's size estimate heuristic and just merge matching/decode steps.