Skip to content

Commit 734603c

Browse files
committed
Add iterator comments
1 parent 21a4067 commit 734603c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

inst/include/cpp11/r_vector.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ class r_vector {
102102
const_iterator find(const r_string& name) const;
103103

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

0 commit comments

Comments
 (0)