bkietz commented on a change in pull request #7026:
URL: https://github.com/apache/arrow/pull/7026#discussion_r417358718



##########
File path: cpp/src/arrow/util/iterator.h
##########
@@ -138,11 +139,11 @@ class Iterator : public 
util::EqualityComparable<Iterator<T>> {
         value_ = IterationTraits<T>::End();
         return;
       }
-      value_ = iterator_.Next();
+      value_ = iterator_->Next();
     }
 
     Result<T> value_;
-    Iterator iterator_;
+    std::shared_ptr<Iterator> iterator_;

Review comment:
       This allows `Iterator::RangeIterator` to be copied, which is a 
requirement on iterators https://en.cppreference.com/w/cpp/named_req/Iterator
   
   We haven't caught this before because we only use `Iterator::begin` and 
`Iterator::end` in the context of range-for loops which don't require it. 
However cython wraps the range-for loop does, however, which is why I noticed 
the concept error.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to