New issue
Advanced search Search tips

Issue 852972 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Rework MSE impl passing of params by const& to be by value where ownership is transferred

Project Member Reported by wolenetz@chromium.org, Jun 14 2018

Issue description

If callee needs to own the param, or if it's making a copy of the param, it's "taking ownership" - even if caller continues to use the original; use pass-by-value.

If caller no longer needs to use the param, it can use std::move with pass-by-value. If callee wants to reduce a copy in the pass-by-value case, it can use std::move.

Why?

See https://chromium-review.googlesource.com/c/chromium/src/+/1099935#message-a0630329edfa4b66e5bea2343a8585235cae8c6b.
 
I've queried if this is correct, at least for RepeatingCallbacks which sometimes tend to have "shared ownership", on https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/_ZCgeYizJhk

Sign in to add a comment