THRIFT-5637: Add `no_constructors` option to C++ compiler
This PR adds the option no_constructors in the C++ generator. This option elides declaring and defining:
- constructor/destructor
- move/copy constructor/assignment
In addition this PR fixes some minor issues:
-
gen_no_skeleton_documentation was incorrect - when
templatesare requested, avoid anyvirtualfunctions
Allowing the compiler to emit the default set of constructor/destructor/assignment operators makes the code faster as it allows inlining when they are trivial. This improves creating deep/elaborate thrift objects.
- [x] Did you create an Apache Jira ticket? (Request account here, not required for trivial changes)
- [x] If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
- [x] Did you squash your changes to a single commit? (not required, but preferred)
- [x] Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
- [ ] If your change does not involve any code, include
[skip ci]anywhere in the commit message to free up build resources.
Perhaps the option should be aggregates instead of no_constructor and classes be made into structs instead?
@Jens-G could you advise how to move this forward?
@Jens-G could you advise how to move this forward?
The usual way would be that someone fom the C++ folks looks at it and decides how to continue.
Awesome, thank you @Jens-G!