sofa icon indicating copy to clipboard operation
sofa copied to clipboard

[Core] Proposition to reduce the number of alias declarations

Open alxbilger opened this issue 1 year ago • 1 comments

The goal is to reduce the number of alias declarations. I propose 2 methods:

  1. using traits (for example DataVecCoord_t<Out>). This is illustrated in Multi2Mapping.
  2. ~~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

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

alxbilger avatar Jun 24 '24 14:06 alxbilger

[ci-build][with-all-tests]

alxbilger avatar Jun 25 '24 07:06 alxbilger