Code review comment for lp:~dandrader/qtmir/allowClientResize

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> On 08/03/2017 09:17, Gerry Boland wrote:
> > + auto extraWindowInfo = getExtraInfo(windowInfo);
> > const auto & <- to save a copy?
>
> Are you sure? getExtraInfo() returns a std::shared_ptr<>. Won't move
> semantics take care of that?

The times that 'const auto&' gains over 'const auto' are mostly those when the function returns a reference.

For any function that returns a type (i.e. not a reference) it is very likely that RVO "takes care of it" and invoking move semantics would actually be less efficient.

« Back to merge proposal