[PATCH] D98477: [ADT] Add IntrusiveVariant
Scott Linder via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 1 08:03:09 PDT 2021
scott.linder added a comment.
In D98477#2660482 <https://reviews.llvm.org/D98477#2660482>, @dblaikie wrote:
> Looks like this visitor infrastructure has some overlap with D99560 <https://reviews.llvm.org/D99560> and D99561 <https://reviews.llvm.org/D99561> - be good to deduplicate some work here, perhaps.
Yes, I agree that factoring out `llvm::makeVisitor` and `llvm::visit` and making it work over all variant-like types makes sense. It's unfortunate that even once we move to C++17 we won't be able to re-open `std` to specialize `std::visit` for our types, at least if I understand correctly. We may just be stuck with `llvm::visit` and `std::visit` living side-by-side?
I also think things like `InPlaceType` could be moved somewhere general; `llvm::Optional` has an `in_place_t` as a `detail`, so pulling all of those new disambiguation types into a common place would also be good.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98477/new/
https://reviews.llvm.org/D98477
More information about the llvm-commits
mailing list