D14235: Fix QStringBuilder taking reference to temporary due to auto

Volker Krause noreply at phabricator.kde.org
Fri Jul 20 12:08:36 BST 2018


vkrause added inline comments.

INLINE COMMENTS

> kossebau wrote in completionhelper.cpp:81
> Many people might not be aware of that trap with QStringBuilder and auto. Or know what QStringBuilder is at all, as it hides away usually.
> One has to be bitten a few times before it's part of mental background code checking perhaps :)
> 
> And I was more thinking of "human" fixers who are in for code consistency or modern looking code (/me tries to look innocent) ;)
> 
> Okay, so being unsure I will leave that comment away for now, too much generalizing from ego perhaps :)

Another possibility might be to keep the auto and force the QString conversion on the right hand side. Slightly more verbose, but protects you from breaking this again.

REPOSITORY
  R32 KDevelop

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

To: kossebau, #kdevelop, shashwatdixit, mwolff, kfunk
Cc: vkrause, kfunk, kdevelop-devel, antismap, iodelay, vbspam, njensen, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180720/677ffff5/attachment.html>


More information about the KDevelop-devel mailing list