[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 19 23:09:44 PDT 2018


lebedev.ri added inline comments.


================
Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:27-32
+  // template<class T>
+  // void f(T func) {
+  //   func();
+  //   ^~~~~~~
+  //   ::std::invoke(func, 1)
+  Finder->addMatcher(callExpr(has(declRefExpr())).bind("functor"), this);
----------------
Bikeshedding: i do not understand the idea behind `std::invoke`.
Why is the new version better/preferred?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52281





More information about the cfe-commits mailing list