D16555: Move construction of ExpectedSignal where it belongs

Denis Kurz noreply at phabricator.kde.org
Thu Nov 1 14:18:53 GMT 2018


dkurz marked an inline comment as done.
dkurz added inline comments.

INLINE COMMENTS

> dvratil wrote in modelspy.h:46
> The move here is kinda pointless: Qt classes are implicitly shared, so copying them means only copying a pointer. And if you make the arguments `const &`, calling the ctor would be a no-copy and initialization of the member variable would be a copy. Your approach requires a copy to call the ctor and then move for initialization - so copy vs copy+move: `const &` wins here :)
> 
> And while this may sound contradictory to what I replied to your email regarding performance compromises when refactoring, the `std::move` does not IMO improve code readability or quality (compared to just passing non-POD args as `const &` ) in this case.

Fully agreed.

REPOSITORY
  R165 Akonadi

REVISION DETAIL
  https://phabricator.kde.org/D16555

To: dkurz, #kde_pim, dvratil
Cc: dvratil, kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20181101/9f037eed/attachment.html>


More information about the kde-pim mailing list