Skip to content

Commit

Permalink
Merge pull request #1228 from wravery/master
Browse files Browse the repository at this point in the history
Explicit cast from size_t to Slice<T>::iterator::difference_type in cxx.h
  • Loading branch information
dtolnay authored Jun 15, 2023
2 parents 76e8a2f + 5f71e87 commit de4bc6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/cxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ typename Slice<T>::iterator::difference_type
Slice<T>::iterator::operator-(const iterator &other) const noexcept {
auto diff = std::distance(static_cast<char *>(other.pos),
static_cast<char *>(this->pos));
return diff / this->stride;
return diff / static_cast<typename Slice<T>::iterator::difference_type>(this->stride);
}

template <typename T>
Expand Down

0 comments on commit de4bc6a

Please sign in to comment.