Skip to content

Commit

Permalink
Add iterator comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisVaughan committed Aug 22, 2024
1 parent 21a4067 commit 734603c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions inst/include/cpp11/r_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ class r_vector {
const_iterator find(const r_string& name) const;

class const_iterator {
// Iterator references:
// https://cplusplus.com/reference/iterator/
// https://stackoverflow.com/questions/8054273/how-to-implement-an-stl-style-iterator-and-avoid-common-pitfalls
// It seems like our iterator doesn't fully implement everything for
// `random_access_iterator_tag` (like an `[]` operator, for example). If we discover
// issues with it, we probably need to add more methods.
private:
const r_vector* data_;
R_xlen_t pos_;
Expand Down

0 comments on commit 734603c

Please sign in to comment.