opensim-core icon indicating copy to clipboard operation
opensim-core copied to clipboard

Remove IKMarkerTask defaulted copy ctor

Open adamkewley opened this issue 2 years ago • 2 comments

Produces warnings in clang13 because it's a pattern that is formally deprecated. See:

https://stackoverflow.com/questions/51863588/warning-definition-of-implicit-copy-constructor-is-deprecated


This change is Reviewable

adamkewley avatar Jun 21 '22 14:06 adamkewley

This could be problematic to the GUI if removed since the SWIG bindings may not be generated if there's no copy constructor, will need to investigate further.

aymanhab avatar Jun 21 '22 15:06 aymanhab

It should generate one implicitly - unless a member variable has no copy constructor (the previous version shouldn't have compiled in that case).

The other alternative is to explicitly default the copy assignment operator (effectively, add that declaration). I think either way would work but it might be that not supplying anything also has the side-effect of implicitly generating the move ctor/assignment (unsure about this)

adamkewley avatar Jun 21 '22 18:06 adamkewley

Merging this straggler: SWIG will certainly generate a copy constructor for the bindings, even if one is not explicitly declared (as in this PR). Otherwise, a large amount of OpenSim code will not work (many components etc. implicitly define the constructor).

adamkewley avatar Jul 10 '23 08:07 adamkewley

@adamkewley Unfortunately this commit broke the GUI build on ci because the copy constructor was not generated. I understand why you'd think this should work except for the fact that the GUI doesn't do much model building while it creates/copies/manipulates all kinds of tools/tasks and many of these are on the old property system so they may not act as expected. I can try to modify the GUI code base in the future but for now I'd appreciate if you'd revert this change. Thank you

aymanhab avatar Jul 13 '23 00:07 aymanhab

Reverted.

Sorry for the mixup Ayman - it is kind of bonkers that SWIG wouldn't generate a copy constructor for a class that automatically has one (in terms of C++) :<.

adamkewley avatar Jul 13 '23 03:07 adamkewley

No problem at all @adamkewley and thanks for the prompt response 👍

aymanhab avatar Jul 13 '23 17:07 aymanhab