[PATCH] D48632: ADT: Move ArrayRef comparison operators into the class

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 09:03:55 PDT 2018


dblaikie accepted this revision.
dblaikie added a subscriber: rsmith.
dblaikie added a comment.
This revision is now accepted and ready to land.

Add the inverse equality test too, perhaps - EXPECT_EQ(V1, AR1) ? Though I realize that looks uninteresting & it is, apparently - that's the tricky case for when op overloads are members (though this change doesn't make it a member)

@rsmith - Could you explain why this change makes a difference? I understand why the original implementation (as a standalone function template) doesn't compile (because T can't be deduced for the ArrayRef<T> pattern when given a SmallVector<T>) but how does making it a friend help matters? & is this the right solution, or does it have any drawbacks/missing cases that should be considered? Should this technique be applied in other places?


Repository:
  rL LLVM

https://reviews.llvm.org/D48632





More information about the llvm-commits mailing list