Skip to content

Defaulting copy constructor, copy assignment, move constructor, and move assignment functions #4645

@jhlegarreta

Description

@jhlegarreta

Description

The dashboard site RogueResearch22 is consistently raising warnings about classes declaring implicit copy constructors, copy assignment operators, etc.
https://learn.microsoft.com/bs-latn-ba/cpp/error-messages/compiler-warnings/c5267?view=msvc-150#remarks

Over the last few days some PRs have addressed some of these warnings:
PR #4626, #4627, #4639

However, every time part of these warnings are fixed, more warnings are raised due to related issues (looks like only 199 warnings can be/are reported at a time to the dashboard).

Impact analysis

Using the ITK_DISALLOW_COPY_AND_MOVE macro does not work for these cases, since they need to allow creating copies, etc.

Thus, these classes contradict what the ITK_DISALLOW_COPY_AND_MOVE macro says about ITK's design. Going forward, probably that needs to be revisited, and a new macro be defined so that defaulting the copy constructor, copy assignment, move constructor, and move assignment functions is done with a single command, and thus saving typing. Maybe multiple macros need to be declared depending on the case, or a macro that defaults some of the cases depending on some parameter.

Expected behavior

No warnings are raised.

Actual behavior

199+ warnings are raised by RogueResearch22.

Versions

OS: Mac10.13
Compiler: AppleClang-rel-x86_64
ITK: master

Additional Information

These implicit declarations now raise warnings, but may be removed in the future:
https://learn.microsoft.com/bs-latn-ba/cpp/error-messages/compiler-warnings/c5267?view=msvc-150#remarks

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:DesignImprovement in the design of a given area

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions