diff --git a/Modules/Core/Common/include/itkPoint.h b/Modules/Core/Common/include/itkPoint.h index e330cf1bfc2..8cd057627b8 100644 --- a/Modules/Core/Common/include/itkPoint.h +++ b/Modules/Core/Common/include/itkPoint.h @@ -99,7 +99,22 @@ class ITK_TEMPLATE_EXPORT Point : public FixedArray Point(const ValueType r[VPointDimension]) : BaseArray(r) {} - /** Pass-through constructors for single values */ + +#if defined(ITK_LEGACY_REMOVE) + /** Prevents copy-initialization from `nullptr`, as well as from `0` (NULL). */ + Point(std::nullptr_t) = delete; + + /** Explicit constructors for single values */ + template + explicit Point(const TPointValueType & v) + : BaseArray(v) + {} + explicit Point(const ValueType & v) + : BaseArray(v) + {} +#else + /** Pass-through constructors for single values + * \note ITK_LEGACY_REMOVE=ON will disallow implicit conversion from a single value. */ template Point(const TPointValueType & v) : BaseArray(v) @@ -107,6 +122,7 @@ class ITK_TEMPLATE_EXPORT Point : public FixedArray Point(const ValueType & v) : BaseArray(v) {} +#endif /** Explicit constructor for std::array. */ explicit Point(const std::array & stdArray)