================
@@ -149,6 +149,29 @@ void DescriptorTableClause::dump(raw_ostream &OS) const {
   OS << ")";
 }
 
+// Helper struct so that we can use the overloaded notation of std::visit
+template <class... Ts> struct OverloadMethods : Ts... {
+  using Ts::operator()...;
+};
+
+template <class... Ts> OverloadMethods(Ts...) -> OverloadMethods<Ts...>;
----------------
bogner wrote:

I feel like it'd be simpler to just define a callable with a templated 
`operator()`:
```c++
namespace {
struct ElementDumper {
  raw_ostream &OS;
  template <typename T> void operator()(const T &Element) const {
    Element.dump(OS);
  }
};
}
```
Then we just need `std::visit(ElementDumper{OS}, Element)` later.

https://github.com/llvm/llvm-project/pull/137690
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to