[PATCH] D99561: Support visitor pattern by PointerUnion.

Eugene Zhulenev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 30 15:44:35 PDT 2021


ezhulenev added inline comments.


================
Comment at: llvm/include/llvm/ADT/PointerUnion.h:302
+
+  template <class... LAMBDAS> auto visit(LAMBDAS... lambdas) {
+    return visit(llvm::makeVisitor(lambdas...));
----------------
`template <typename...` seems to be ~5x times more common in the llvm codebase, though didn't find anything in the style guide (google style guide recommends `typename`)


================
Comment at: llvm/unittests/ADT/PointerUnionTest.cpp:175
+           [&](double *doublePtr) { ptr = doublePtr; });
+  EXPECT_EQ(&d, ptr);
+}
----------------
I'd add a test case with labmdas returning values?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99561/new/

https://reviews.llvm.org/D99561



More information about the llvm-commits mailing list