D16250: Use lambdas instead of std::bind()

2018-11-19 Thread Alexander Volkov
volkov closed this revision.

REPOSITORY
  R127 KWayland

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

To: volkov, #kwin, davidedmundson
Cc: bruns, davidedmundson, ivan, kde-frameworks-devel, michaelh, ngraham


D16250: Use lambdas instead of std::bind()

2018-11-19 Thread David Edmundson
davidedmundson accepted this revision.
This revision is now accepted and ready to land.

REPOSITORY
  R127 KWayland

BRANCH
  master

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

To: volkov, #kwin, davidedmundson
Cc: bruns, davidedmundson, ivan, kde-frameworks-devel, michaelh, ngraham


D16250: Use lambdas instead of std::bind()

2018-11-19 Thread Alexander Volkov
volkov added a comment.


  https://clang.llvm.org/extra/clang-tidy/checks/modernize-avoid-bind.html
  
  > std::bind can be hard to read and can result in larger object files and 
binaries due to type information that will not be produced by equivalent 
lambdas.

REPOSITORY
  R127 KWayland

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

To: volkov, #kwin
Cc: bruns, davidedmundson, ivan, kde-frameworks-devel, michaelh, ngraham


D16250: Use lambdas instead of std::bind()

2018-10-16 Thread Alexander Volkov
volkov added a comment.


  @davidedmundson
  
  Lambdas are more readable.

REPOSITORY
  R127 KWayland

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

To: volkov, #kwin
Cc: bruns, davidedmundson, ivan, kde-frameworks-devel, michaelh, ngraham


D16250: Use lambdas instead of std::bind()

2018-10-16 Thread Ivan Čukić
ivan added a comment.


  @davidedmundson
  
  Lambdas are generally faster to compile and execute. `std::bind` can make 
code less verbose, but that is not the case here.
  
  @bruns
  
  Well... Qt has quite a few strange guidelines that we don't follow :)

REPOSITORY
  R127 KWayland

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

To: volkov, #kwin
Cc: bruns, davidedmundson, ivan, kde-frameworks-devel, michaelh, ngraham


D16250: Use lambdas instead of std::bind()

2018-10-16 Thread Stefan Brüns
bruns added a comment.


  In D16250#344183 , @ivan wrote:
  
  > The parentheses are not necessary when a lambda has no arguments.
  >
  >   [something]() { ::: }
  >   
  >
  > can become:
  >
  >   [something] { ::: }
  >   
  >   
  >
  > KWin uses both of these from what I've seen. Personally, I prefer the 
second.
  >
  > Otherwise, +1 for the change.
  
  
  Qt coding style  mandates the 
first

REPOSITORY
  R127 KWayland

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

To: volkov, #kwin
Cc: bruns, davidedmundson, ivan, kde-frameworks-devel, michaelh, ngraham


D16250: Use lambdas instead of std::bind()

2018-10-16 Thread David Edmundson
davidedmundson added a comment.


  > Use lambdas instead of std::bind()
  
  Why?

REPOSITORY
  R127 KWayland

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

To: volkov, #kwin
Cc: davidedmundson, ivan, kde-frameworks-devel, michaelh, ngraham, bruns


D16250: Use lambdas instead of std::bind()

2018-10-16 Thread Ivan Čukić
ivan added a comment.


  The parentheses are not necessary when a lambda has no arguments.
  
[something]() { ::: }
  
  can become:
  
[something] { ::: }
  
  KWin uses both of these from what I've seen. Personally, I prefer the second.
  
  Otherwise, +1 for the change.

REPOSITORY
  R127 KWayland

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

To: volkov, #kwin
Cc: ivan, kde-frameworks-devel, michaelh, ngraham, bruns


D16250: Use lambdas instead of std::bind()

2018-10-16 Thread Alexander Volkov
volkov added a reviewer: KWin.

REPOSITORY
  R127 KWayland

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

To: volkov, #kwin
Cc: kde-frameworks-devel, michaelh, ngraham, bruns


D16250: Use lambdas instead of std::bind()

2018-10-16 Thread Alexander Volkov
volkov created this revision.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
volkov requested review of this revision.

REPOSITORY
  R127 KWayland

BRANCH
  master

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

AFFECTED FILES
  src/server/idle_interface.cpp
  src/server/pointerconstraints_interface.cpp

To: volkov
Cc: kde-frameworks-devel, michaelh, ngraham, bruns