File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -855,14 +855,14 @@ template <typename T, int ExtraFlags = array::forcecast> class array_t : public
855855
856856 // Reference to element at a given index
857857 template <typename ... Ix> const T& at (Ix... index) const {
858- if (sizeof ...(index) != ndim ())
858+ if (( ssize_t ) sizeof ...(index) != ndim ())
859859 fail_dim_check (sizeof ...(index), " index dimension mismatch" );
860860 return *(static_cast <const T*>(array::data ()) + byte_offset (ssize_t (index)...) / itemsize ());
861861 }
862862
863863 // Mutable reference to element at a given index
864864 template <typename ... Ix> T& mutable_at (Ix... index) {
865- if (sizeof ...(index) != ndim ())
865+ if (( ssize_t ) sizeof ...(index) != ndim ())
866866 fail_dim_check (sizeof ...(index), " index dimension mismatch" );
867867 return *(static_cast <T*>(array::mutable_data ()) + byte_offset (ssize_t (index)...) / itemsize ());
868868 }
You can’t perform that action at this time.
0 commit comments