Skip to content

Commit 3eb58d1

Browse files
authored
Revert "[libc] Add reverse_iterator comparisons" (llvm#86186)
Reverts llvm#86147
1 parent c96b61a commit 3eb58d1

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

libc/src/__support/CPP/iterator.h

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,13 @@ namespace cpp {
2020
template <typename T> struct iterator_traits;
2121
template <typename T> struct iterator_traits<T *> {
2222
using reference = T &;
23-
using value_type = T;
2423
};
2524

2625
template <typename Iter> class reverse_iterator {
2726
Iter current;
2827

2928
public:
3029
using reference = typename iterator_traits<Iter>::reference;
31-
using value_type = typename iterator_traits<Iter>::value_type;
32-
using iterator_type = Iter;
3330

3431
LIBC_INLINE reverse_iterator() : current() {}
3532
LIBC_INLINE constexpr explicit reverse_iterator(Iter it) : current(it) {}
@@ -41,38 +38,6 @@ template <typename Iter> class reverse_iterator {
4138
LIBC_INLINE constexpr explicit reverse_iterator(const Other &it)
4239
: current(it) {}
4340

44-
LIBC_INLINE friend constexpr bool operator==(const reverse_iterator &lhs,
45-
const reverse_iterator &rhs) {
46-
return lhs.base() == rhs.base();
47-
}
48-
49-
LIBC_INLINE friend constexpr bool operator!=(const reverse_iterator &lhs,
50-
const reverse_iterator &rhs) {
51-
return lhs.base() != rhs.base();
52-
}
53-
54-
LIBC_INLINE friend constexpr bool operator<(const reverse_iterator &lhs,
55-
const reverse_iterator &rhs) {
56-
return lhs.base() > rhs.base();
57-
}
58-
59-
LIBC_INLINE friend constexpr bool operator<=(const reverse_iterator &lhs,
60-
const reverse_iterator &rhs) {
61-
return lhs.base() >= rhs.base();
62-
}
63-
64-
LIBC_INLINE friend constexpr bool operator>(const reverse_iterator &lhs,
65-
const reverse_iterator &rhs) {
66-
return lhs.base() < rhs.base();
67-
}
68-
69-
LIBC_INLINE friend constexpr bool operator>=(const reverse_iterator &lhs,
70-
const reverse_iterator &rhs) {
71-
return lhs.base() <= rhs.base();
72-
}
73-
74-
LIBC_INLINE constexpr iterator_type base() const { current; }
75-
7641
LIBC_INLINE constexpr reference operator*() const {
7742
Iter tmp = current;
7843
return *--tmp;

0 commit comments

Comments
 (0)