[ 
https://issues.apache.org/jira/browse/ARROW-5508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16917538#comment-16917538
 ] 

Micah Kornfield commented on ARROW-5508:
----------------------------------------

My only comment on this is might pay to sketch out what iteration looks like in 
each case. 

 

Using StopIteration and Result I think you get something like:

while (RETURN_IF_NOT_STOPPED_ERROR(v,  iter.next()) {

    doSomethingWith(v)

}

Not sure if the macros to make that nice are even vaible.

 

"As for signaling completion without consuming a value, well, the problem is 
that not all iterators may support that. Is there a use case where this 
matters?"

I think in many cases this can be solved with a "peek" style iterator?

 

 

> [C++] Create reusable Iterator<T> interface 
> --------------------------------------------
>
>                 Key: ARROW-5508
>                 URL: https://issues.apache.org/jira/browse/ARROW-5508
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Wes McKinney
>            Priority: Major
>             Fix For: 0.15.0
>
>
> We have various iterator-like classes. I envision a reusable interface like
> {code}
> template <typename T>
> class Iterator {
>  public:
>   virtual ~Iterator() = default;
>   virtual Status Next(T* out) = 0;
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to