Skip to content

Commit 6b5eed2

Browse files
committed
ENH: Add static_assert(VLength > 0) to FixedArray
Zero-length arrays were never actively supported by `itk::FixedArray`. `FixedArray` uses a C array, so if it would compile at all, it would depend on a non-standard compiler extension. It appears unnecessary to support zero-length, given one of the main purposes of `itk::FixedArray`: being a common base class of Point, Vector, CovariantVector, RGBAPixel, RGBAPixel and SymmetricSecondRankTensor.
1 parent fac7043 commit 6b5eed2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/Core/Common/include/itkFixedArray.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ namespace itk
5252
template <typename TValue, unsigned int VLength = 3>
5353
class ITK_TEMPLATE_EXPORT FixedArray
5454
{
55+
static_assert(VLength > 0);
56+
5557
public:
5658
/** Length constant */
5759
static constexpr unsigned int Length = VLength;

0 commit comments

Comments
 (0)