If the parent patch (or something similar) is accepted, then this is equivalent to https://reviews.llvm.org/D99561 and could supercede it, possibly with the addition of the match convenience method.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/ADT/PointerUnion.h | ||
---|---|---|
284 | Is this the only reason the variant traits needs to be befriended by the PointerUnion? If so, perhaps this API could be exposed in PointerUnion's public API rather than using friendship? |
llvm/include/llvm/ADT/PointerUnion.h | ||
---|---|---|
284 | From a pure perspective I think it is an implementation detail, which is the same reason I didn't expose the index in IntrusiveVariant either. It seems reasonable to expose, as std::variant does expose an ::index method, but I can't think of many uses of it that don't have a better, type-safe alternative. |
llvm/include/llvm/ADT/PointerUnion.h | ||
---|---|---|
284 | Eh, I don't feel too strongly about it - but figure if it's an important feature for VariantTraits, that seems like as good a reason as any for it to be public (since you can access the property via variant traits anyway - so why not access it directly at that point?). Up to you. |
Is this the only reason the variant traits needs to be befriended by the PointerUnion? If so, perhaps this API could be exposed in PointerUnion's public API rather than using friendship?