Skip to content

Commit

Permalink
intentionally step past the end iterator
Browse files Browse the repository at this point in the history
this is safe:
#6 (comment)
  • Loading branch information
pauldreik committed Jul 27, 2024
1 parent cf20e42 commit 2ac5a45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libstdcpp/unicode-utf-iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ blah(auto data)

// this does not cause a runtime error, the iterator class protects against
// misuse
[[maybe_unused]] auto illegal = *v.end();
for (int i = 0; i < 8; ++i) {
[[maybe_unused]] auto illegal = *v.end();
}
return 0;
}
}
Expand Down

0 comments on commit 2ac5a45

Please sign in to comment.