forked from OSchip/llvm-project
Revert "ADT: Move ArrayRef comparison operators into the class"
This reverts commit r335839, because it breaks the MSVC build. llvm-svn: 335844
This commit is contained in:
parent
0050466976
commit
850bfde4ab
|
@ -272,16 +272,6 @@ namespace llvm {
|
|||
return std::vector<T>(Data, Data+Length);
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @name Comparison operators
|
||||
/// @{
|
||||
|
||||
friend bool operator==(ArrayRef LHS, ArrayRef RHS) {
|
||||
return LHS.equals(RHS);
|
||||
}
|
||||
|
||||
friend bool operator!=(ArrayRef LHS, ArrayRef RHS) { return !(LHS == RHS); }
|
||||
|
||||
/// @}
|
||||
};
|
||||
|
||||
|
@ -520,6 +510,22 @@ namespace llvm {
|
|||
return MutableArrayRef<T>(data, length);
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @name ArrayRef Comparison Operators
|
||||
/// @{
|
||||
|
||||
template<typename T>
|
||||
inline bool operator==(ArrayRef<T> LHS, ArrayRef<T> RHS) {
|
||||
return LHS.equals(RHS);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline bool operator!=(ArrayRef<T> LHS, ArrayRef<T> RHS) {
|
||||
return !(LHS == RHS);
|
||||
}
|
||||
|
||||
/// @}
|
||||
|
||||
// ArrayRefs can be treated like a POD type.
|
||||
template <typename T> struct isPodLike;
|
||||
template <typename T> struct isPodLike<ArrayRef<T>> {
|
||||
|
|
|
@ -188,10 +188,6 @@ TEST(ArrayRefTest, Equals) {
|
|||
EXPECT_TRUE(AR1b.equals({3, 4, 5, 6}));
|
||||
EXPECT_FALSE(AR1b.equals({2, 3, 4, 5, 6}));
|
||||
EXPECT_FALSE(AR1b.equals({3, 4, 5, 6, 7}));
|
||||
|
||||
SmallVector<int, 8> V1{1, 2, 3, 4, 5, 6, 7, 8};
|
||||
EXPECT_EQ(AR1, V1);
|
||||
EXPECT_EQ(V1, AR1);
|
||||
}
|
||||
|
||||
TEST(ArrayRefTest, EmptyEquals) {
|
||||
|
|
Loading…
Reference in New Issue