[PATCH] D99561: Support visitor pattern by PointerUnion.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 2 11:30:14 PDT 2021


dblaikie added a comment.

In D99561#2665896 <https://reviews.llvm.org/D99561#2665896>, @bakhtiyarneyman wrote:

> Aligned the calling convention of `visit` to match that of `std::visit`. Renamed the more convenient version of `visit` to `match` to have the best of the two worlds: better ergonomics and not clashing with `std::visit`.

I'm still inclined towards only exposing the standard phrasing - even with a different name, it'll be a matter of "Oh, what's this match thing?" when it could be "Oh, I've seen this visit thing before" and also the issue of "Oh, I'm used to using x.match(a, b) - ah, bother, this is the standard thing that doesn't support x.match, I have to use visit(a, b, x) instead".


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