-
-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Declare converting Point(v)
constructors explicit
#3237
ENH: Declare converting Point(v)
constructors explicit
#3237
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it, but I worry that there could be external code that depends upon the deprecated behavior. Do we need to use the usual mechanism for deprecation?
Prevented implicit conversion of a value to `Point`. Aims to avoid possible flaws, like the ones addressed by: Pull request InsightSoftwareConsortium#3225 commit 5b71d63 "BUG: Quick-fix ContourSpatialObject::Update(), LINEAR_INTERPOLATION case" Pull request InsightSoftwareConsortium#3228 commit 12a501c "BUG: Fix `SetCenterInObjectSpace` calls in Registration test" Pull request InsightSoftwareConsortium#3231 commit e4841aa "STYLE: Clarify estimation ray position `RayCastInterpolateImageFunction`" Deleted `Point(nullptr_t)`, especially to avoid `PointType p = 0`.
2781baa
to
415bad7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Thanks @Leengit I just added an ITK_LEGACY_REMOVE check, to allow legacy support. Please check the force-push! Note that it does not produce a "deprecate warning", it just allows users to get the old (legacy) behavior back, by ITK_LEGACY_REMOVE=OFF |
Compilation errors were purposely introduced by InsightSoftwareConsortium/ITK#3237
Until now, this constructor was only declared `explicit` for "future" builds (when `ITK_LEGACY_FUTURE_REMOVE` would be enabled). Follow-up to commit a890962 "ENH: Make Vector construction from scalar value explicit" by Brian Helba, January 26, 2015 Added a _deleted_ `Vector(nullptr_t)` constructor, especially to avoid erroneous user code like `VectorType v = 0`. Analog to: pull request InsightSoftwareConsortium#3237 commit 8825834 ENH: Declare converting `Point(v)` constructors `explicit`
Until now, this constructor was only declared `explicit` for "future" builds (when `ITK_LEGACY_FUTURE_REMOVE` would be enabled). Follow-up to commit a890962 "ENH: Make Vector construction from scalar value explicit" by Brian Helba, January 26, 2015 Added a _deleted_ `Vector(nullptr_t)` constructor, especially to avoid erroneous user code like `VectorType v = 0`. Analog to: pull request #3237 commit 8825834 ENH: Declare converting `Point(v)` constructors `explicit`
Allowing ITK_LEGACY_REMOVE=0N for ITK version >= 5.3rc04, which made those constructors `explicit`: - ITK pull request InsightSoftwareConsortium/ITK#3237 commit InsightSoftwareConsortium/ITK@8825834 "ENH: Declare converting `Point(v)` constructors `explicit`" - ITK pull request InsightSoftwareConsortium/ITK#3255 commit InsightSoftwareConsortium/ITK@abb88cc "ENH: Make Vector constructor from scalar explicit, unless LEGACY enabled"
Allowing ITK_LEGACY_REMOVE=0N for ITK version >= 5.3rc04, which made those constructors `explicit`: - ITK pull request InsightSoftwareConsortium/ITK#3237 commit InsightSoftwareConsortium/ITK@8825834 "ENH: Declare converting `Point(v)` constructors `explicit`" - ITK pull request InsightSoftwareConsortium/ITK#3255 commit InsightSoftwareConsortium/ITK@abb88cc "ENH: Make Vector constructor from scalar explicit, unless LEGACY enabled"
Allowing ITK_LEGACY_REMOVE=0N for ITK version >= 5.3rc04, which made those constructors `explicit`: - ITK pull request InsightSoftwareConsortium/ITK#3237 commit InsightSoftwareConsortium/ITK@8825834 "ENH: Declare converting `Point(v)` constructors `explicit`" - ITK pull request InsightSoftwareConsortium/ITK#3255 commit InsightSoftwareConsortium/ITK@abb88cc "ENH: Make Vector constructor from scalar explicit, unless LEGACY enabled"
Prevented implicit conversion of a value to
Point
. Aims to avoidpossible flaws, like the ones addressed by:
Pull request #3225
commit 5b71d63
"BUG: Quick-fix ContourSpatialObject::Update(), LINEAR_INTERPOLATION case"
Pull request #3228
commit 12a501c
"BUG: Fix
SetCenterInObjectSpace
calls in Registration test"Pull request #3231
commit e4841aa
"STYLE: Clarify estimation ray position
RayCastInterpolateImageFunction
"Deleted
Point(nullptr_t)
, especially to avoidPointType p = 0
.