[Differential] [Commented On] D3987: Use nullptr in all Frameworks (just diff in KIO shown here)

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Wed Jan 18 16:41:07 UTC 2017


kossebau added a comment.


  In https://phabricator.kde.org/D3987#78426, @kfunk wrote:
  
  > In https://phabricator.kde.org/D3987#78421, @kossebau wrote:
  >
  > >   void foo(T* t);
  > >   void foo(QFlags<Flag> flags);
  > >
  >
  >
  > Both `foo(0)` & `foo(nullptr)` would call `void foo(T* t)`, no? => No change
  
  
  One second after I clicked "Submit" I thought "meh, should have checked before if that really is the case" ;) Might be not indeed. Perhaps this might also explain why there is this otherwise (to me) strange nullptr default value with the QFlags constructor, as it will avoid ambiguity WRT implicit conversion.
  
  So allow me to reduce that remark to: if one adds an overload with a pointer argument in an API, all consumer of that API will not notice that suddenly all their calls switch to the  pointer overload. Does that hold?

REPOSITORY
  R280 Prison

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

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: kfunk, #frameworks, dfaure, kossebau
Cc: kossebau, dfaure, graesslin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170118/3724c889/attachment.html>


More information about the Kde-frameworks-devel mailing list