arrow-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wes McKinney (JIRA)" <>
Subject [jira] [Updated] (ARROW-328) [C++] Return shared_ptr by value instead of const-ref?
Date Sat, 10 Dec 2016 01:05:59 GMT


Wes McKinney updated ARROW-328:
    Assignee: Wes McKinney


> [C++] Return shared_ptr by value instead of const-ref?
> ------------------------------------------------------
>                 Key: ARROW-328
>                 URL:
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Wes McKinney
>            Assignee: Wes McKinney
> This is largely my fault but: many C++ programmers seem to feel that you should always
return {{std::shared_ptr}} by value for a couple reasons:
> * RVO in many cases prevents a double ref-count manipulation and,
> * If you are planning to share ownership with the other class, you will need to copy
the shared_ptr anyway
> On some contemplation I'm +1 on changing all {{const std::shared_ptr<T>&}}
to {{std::shared_ptr<T>}}, but let me know if there are other opinions. 

This message was sent by Atlassian JIRA

View raw message