dsharlet / array

C++ multidimensional arrays in the spirit of the STL
Apache License 2.0
198 stars 15 forks source link

dim allows copy construction with compile-time incompatible strides #21

Closed dsharlet closed 4 years ago

dsharlet commented 4 years ago

Probably what is going on is https://github.com/dsharlet/array/blob/b36aaefbdfd00e67b00070ae86c5a021e284444a/array.h#L363-L371 fails due to the enable_ifs. Then the argument is converted to a range and https://github.com/dsharlet/array/blob/b36aaefbdfd00e67b00070ae86c5a021e284444a/array.h#L359-L360 is used.

This is a really ugly behavior, something that should fail at compile time builds and produces subtly incorrect results at runtime instead!