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

Antoine Pitrou commented on ARROW-5508:
---------------------------------------

We could also take a page from Python and have a special 
{{Status::StopIteration}} to signal completion.

I also think it's essential to be able to return errors - either via {{Status}} 
or {{Result<T>}}.

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?

> [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