You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Antoine Pitrou (Jira)" <ji...@apache.org> on 2020/09/28 11:34:02 UTC
[jira] [Resolved] (ARROW-8618) [C++] ASSIGN_OR_RAISE should move
its argument
[ https://issues.apache.org/jira/browse/ARROW-8618?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Antoine Pitrou resolved ARROW-8618.
-----------------------------------
Resolution: Fixed
Issue resolved by pull request 8264
[https://github.com/apache/arrow/pull/8264]
> [C++] ASSIGN_OR_RAISE should move its argument
> ----------------------------------------------
>
> Key: ARROW-8618
> URL: https://issues.apache.org/jira/browse/ARROW-8618
> Project: Apache Arrow
> Issue Type: Improvement
> Components: C++
> Affects Versions: 0.17.0
> Reporter: Ben Kietzman
> Assignee: Ben Kietzman
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.0.0
>
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> Since {{ASSIGN_OR_RAISE}} consumes its {{Result}} argument anyway, there's no reason not to cast that argument to an rvalue reference whenever possible. This will decrease boilerplate when handling non-temporary {{Result}}s, for example when yielding from an iterator:
> {code}
> for (auto maybe_batch : scan_task->Execute()) {
> - ASSIGN_OR_RAISE(auto batch, std::move(maybe_batch));
> + ASSIGN_OR_RAISE(auto batch, maybe_batch);
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)