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

Consider to redesign generated C++ read constructor #565

Open
mikir opened this issue Jan 15, 2024 · 0 comments
Open

Consider to redesign generated C++ read constructor #565

mikir opened this issue Jan 15, 2024 · 0 comments
Labels
c++ C++ language generator code generator compatibility This can break backward compatibility of generated code enhancement New feature or request

Comments

@mikir
Copy link
Contributor

mikir commented Jan 15, 2024

Currently, the generated C++ read constructor reads all fields in constructor initializers using dedicated private read methods. This solution strongly relies on Return Value Optimization and leads to many move constructor calls in case of arrays or optional fields.

It will be probably better to leave all fields to be initialized by default and then read them in the constructor body.

@mikir mikir added enhancement New feature or request c++ C++ language generator code generator compatibility This can break backward compatibility of generated code labels Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ C++ language generator code generator compatibility This can break backward compatibility of generated code enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant