Skip to content

Commit

Permalink
Limit iterator types to input_iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
wdconinc committed Aug 1, 2022
1 parent c5ba30d commit cf57887
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/templates/macros/iterator.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public:
using value_type = {{ prefix }}{{ class.bare_type }};
using pointer = {{ prefix }}{{ class.bare_type }}*;
using reference = {{ prefix }}{{ class.bare_type }}&;
using iterator_category = std::bidirectional_iterator_tag;
using iterator_category = std::input_iterator_tag;

{{ iterator_type }}()
: m_index(0), m_object(nullptr), m_collection(nullptr) {};
Expand Down Expand Up @@ -54,7 +54,7 @@ public:
using value_type = {{prefix}}{{ class.bare_type }};
using pointer = {{prefix}}{{ class.bare_type }}*;
using reference = {{prefix}}{{ class.bare_type }}&;
using iterator_category = std::bidirectional_iterator_tag;
using iterator_category = std::input_iterator_tag;

{{ iterator_type }}()
: m_index(0), m_object(nullptr), m_collection(nullptr) {};
Expand Down

0 comments on commit cf57887

Please sign in to comment.