You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Ben Kietzman (Jira)" <ji...@apache.org> on 2019/11/07 14:49:00 UTC
[jira] [Updated] (ARROW-7086) [C++] Provide a wrapper for invoking
factories to produce a Result
[ https://issues.apache.org/jira/browse/ARROW-7086?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ben Kietzman updated ARROW-7086:
--------------------------------
Description:
There is a proliferation of code like:
{code}
Result<int> SafeAdd(int a, int b) {
int out;
RETURN_NOT_OK(DoSafeAdd(a, b, &out));
return out;
}
{code}
Ideally, this should be resolved by moving the implementation of SafeAdd into the Result returning function then using {{Result::Value}} in the Status returning function. In cases where this is inconvenient, it'd be helpful to have an adapter for doing this more efficiently:
{code}
Result<int> SafeAdd(int a, int b) {
return RESULT_INVOKE(DoSafeAdd, a, b);
}
{code}
was:
There is a proliferation of code like:
{code}
Result<int> SafeAdd(int a, int b) {
int out;
RETURN_NOT_OK(DoSafeAdd(a, b, &out));
return out;
}
{code}
Ideally, this should be resolved by moving the implementation of SafeAdd into the Result returning function then using {{Result::Value}} in the Status returning function. In cases where this is inconvenient, it'd be helpful to have an adapter for doing this more efficiently:
{code}
Result<int> SafeAdd(int a, int b) {
return ResultInvoke(DoSafeAdd, a, b);
}
{code}
> [C++] Provide a wrapper for invoking factories to produce a Result
> ------------------------------------------------------------------
>
> Key: ARROW-7086
> URL: https://issues.apache.org/jira/browse/ARROW-7086
> Project: Apache Arrow
> Issue Type: Improvement
> Components: C++
> Affects Versions: 0.15.1
> Reporter: Ben Kietzman
> Assignee: Ben Kietzman
> Priority: Major
> Fix For: 1.0.0
>
>
> There is a proliferation of code like:
> {code}
> Result<int> SafeAdd(int a, int b) {
> int out;
> RETURN_NOT_OK(DoSafeAdd(a, b, &out));
> return out;
> }
> {code}
> Ideally, this should be resolved by moving the implementation of SafeAdd into the Result returning function then using {{Result::Value}} in the Status returning function. In cases where this is inconvenient, it'd be helpful to have an adapter for doing this more efficiently:
> {code}
> Result<int> SafeAdd(int a, int b) {
> return RESULT_INVOKE(DoSafeAdd, a, b);
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)