D23902: [KCoreDirLister] replace deprecated foreach with range-for

Ahmad Samir noreply at phabricator.kde.org
Fri Oct 4 16:02:23 BST 2019


ahmadsamir added a comment.


  In D23902#542026 <https://phabricator.kde.org/D23902#542026>, @dfaure wrote:
  
  > For the record, JFBastien was actually wrong. Calling .begin() on a const return value does call the const overload. Testcase http://www.davidfaure.fr/kde/const_retval.cpp
  
  
  That looks like a failure in communication, either one of you _assumed_ something but didn't tell the other. :D
  
  > But returning const QList would inhibit move semantics, e.g. `QList<int> mylist = foo();` copies instead of moving.
  >  So yeah, better not do that.
  
  And it would detach (I don't know why it feels like detaching for Qt containers is like a sword hanging over all, especially new, developers' heads; so implicit sharing is great, except you have to worry about the container detaching for the rest of its natural life... :)).

REPOSITORY
  R241 KIO

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

To: ahmadsamir, kde-frameworks-devel, dfaure
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191004/506c3e96/attachment.html>


More information about the Kde-frameworks-devel mailing list