You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a copy of the variable will never be made then pass const T& if the object is deep and T if the object is shallow (note, I find this deep/shallow thing annoying because things that start out shallow can become deep, so I'm open to improvement)
If a copy of the variable might be made (or will always be made) then pass T to allow the caller to std::move and avoid the copy
If the variable itself needs to be modified (e.g. an out parameter) then pass T*. This is different than the google C++ style guide which prefers T&. In Arrow, T* is preferred because it makes it obvious the value is being modified at the call site.
The text was updated successfully, but these errors were encountered:
The rules we use in Arrow are:
const T&
if the object is deep andT
if the object is shallow (note, I find this deep/shallow thing annoying because things that start out shallow can become deep, so I'm open to improvement)T
to allow the caller tostd::move
and avoid the copyT*
. This is different than the google C++ style guide which prefersT&
. In Arrow,T*
is preferred because it makes it obvious the value is being modified at the call site.The text was updated successfully, but these errors were encountered: