InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.41k stars 663 forks source link

Add ValueInitializedIsZeroFilled tests, replace `MakeFilled<Self>(NumericTraits<T>::ZeroValue())` with `Self{}` #4454

Closed N-Dekker closed 7 months ago

N-Dekker commented 7 months ago

Tested that a "value-initialized" object of one of the FixedArray derived types, CovariantVector DiffusionTensor3D, RGBAPixel, RGBPixel, SymmetricSecondRankTensor, Point, or Vector is zero-filled.

Replaced MakeFilled<Self>(NumericTraits<T>::ZeroValue()) with Self{} in the ZeroValue() implementation of NumericTraits specializations.


Used the syntax T{} to create "value-initialized" objects of each of those types, see also: https://en.cppreference.com/w/cpp/language/value_initialization