Skip to content

Commit

Permalink
adjacency matrix: handle conversion warning
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Feb 7, 2025
1 parent 1a3e16d commit 9f7be95
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/entt/graph/adjacency_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ template<typename It>
class edge_iterator {
using size_type = std::size_t;

void find_next() noexcept {
using diff_type = typename It::difference_type;
for(; pos != last && !it[static_cast<diff_type>(pos)]; pos += offset) {}
}

public:
using value_type = std::pair<size_type, size_type>;
using pointer = input_iterator_pointer<value_type>;
Expand All @@ -37,11 +42,12 @@ class edge_iterator {
pos{from},
last{to},
offset{step} {
for(; pos != last && !it[pos]; pos += offset) {}
find_next();
}

constexpr edge_iterator &operator++() noexcept {
for(pos += offset; pos != last && !it[pos]; pos += offset) {}
pos += offset;
find_next();
return *this;
}

Expand Down

0 comments on commit 9f7be95

Please sign in to comment.