@@ -99,8 +99,9 @@ class flat_matrix {
9999 // / @brief Dereferences the iterator to the current row.
100100 // / @return A subrange representing the row at the current position
101101 [[nodiscard]] reference operator *() const noexcept {
102- const auto row_beg = this ->_data_iter + this ->_row_idx * this ->_row_size ;
103- return reference (row_beg, row_beg + this ->_row_size );
102+ const auto row_beg =
103+ this ->_data_iter + static_cast <std::ptrdiff_t >(this ->_row_idx * this ->_row_size );
104+ return reference (row_beg, row_beg + static_cast <std::ptrdiff_t >(this ->_row_size ));
104105 }
105106
106107 // / @brief Random access to a row at an offset from the current position.
@@ -484,8 +485,8 @@ class flat_matrix {
484485 // / @pre `r < n_rows()`; otherwise Undefined Behavior
485486 // / @warning No bounds checking is performed for performance.
486487 [[nodiscard]] row_type operator [](size_type r) {
487- const auto row_beg = this ->_data .begin () + r * this ->_n_cols ;
488- return row_type (row_beg, row_beg + this ->_n_cols );
488+ const auto row_beg = this ->_data .begin () + static_cast <std:: ptrdiff_t >( r * this ->_n_cols ) ;
489+ return row_type (row_beg, row_beg + static_cast <std:: ptrdiff_t >( this ->_n_cols ) );
489490 }
490491
491492 // / @brief Returns a const row at the given index without bounds checking.
@@ -494,8 +495,8 @@ class flat_matrix {
494495 // / @pre `r < n_rows()`; otherwise Undefined Behavior
495496 // / @warning No bounds checking is performed.
496497 [[nodiscard]] const_row_type operator [](size_type r) const {
497- const auto row_beg = this ->_data .begin () + r * this ->_n_cols ;
498- return const_row_type (row_beg, row_beg + this ->_n_cols );
498+ const auto row_beg = this ->_data .begin () + static_cast <std:: ptrdiff_t >( r * this ->_n_cols ) ;
499+ return const_row_type (row_beg, row_beg + static_cast <std:: ptrdiff_t >( this ->_n_cols ) );
499500 }
500501
501502 // / @brief Returns a reference to an element without bounds checking.
0 commit comments