ITK icon indicating copy to clipboard operation
ITK copied to clipboard

COMP: Test deleted virtual methods / destructors

Open Leengit opened this issue 3 years ago • 1 comments

Description

As discussed in #3389, there are virtual methods (in this case, all destructors) that are marked as = delete, and there are compilers that should be given a chance to complain about that. This issue is a request that we add testing code to exercise these destructors. If the compilers are not happy then the underlying code would need to be modifed as well; likely in a manner similar to #3389 . Via egrep 'virtual .*delete;' the following for instances are identified https://github.com/InsightSoftwareConsortium/ITK/blob/dfa33a74c6fce77cc75e1c37235fbee84b2ba103/Modules/IO/ImageBase/include/itkConvertPixelBuffer.h#L60 https://github.com/InsightSoftwareConsortium/ITK/blob/dfa33a74c6fce77cc75e1c37235fbee84b2ba103/Modules/IO/MeshBase/include/itkConvertArrayPixelBuffer.h#L45 https://github.com/InsightSoftwareConsortium/ITK/blob/dfa33a74c6fce77cc75e1c37235fbee84b2ba103/Modules/IO/MeshBase/include/itkConvertVariableLengthVectorPixelBuffer.h#L45 https://github.com/InsightSoftwareConsortium/ITK/blob/dfa33a74c6fce77cc75e1c37235fbee84b2ba103/Modules/Numerics/Statistics/include/itkKdTree.h#L131

@jhlegarreta

Leengit avatar Apr 21 '22 15:04 Leengit

I do not have a strong opinion on this Lee (besides the fact that destructors should also be exercised explicitly if necessary IMO); if you feel the same fix should apply here, it is good for me, but I prefer others to comment on this.

jhlegarreta avatar Apr 21 '22 15:04 jhlegarreta