[Core] Proposition to reduce the number of alias declarations #4788
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal is to reduce the number of alias declarations. I propose 2 methods:
DataVecCoord_t<Out>
). This is illustrated inMulti2Mapping
.using a set of macros. The aliases are still declared, but it is hidden inside the macro.I find the trait approach elegant (nothing is hidden and no use of macro or additional code), but too much verbose when only one template parameter is available (e.g.
TetrahedronFEMForceField
).The advantage of the macro is that it does not require changes in the code other than the alias declarations.
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if