Remove use of unreserved identifier (_Self)

And some unnecessary inline keywords

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232304 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2015-03-15 01:42:28 +00:00
parent 00286ad35f
commit 3cfe5cb8b3

View File

@@ -123,7 +123,6 @@ public:
typedef void reference; // Can't modify value returned by fn typedef void reference; // Can't modify value returned by fn
typedef RootIt iterator_type; typedef RootIt iterator_type;
typedef mapped_iterator<RootIt, UnaryFunc> _Self;
inline const RootIt &getCurrent() const { return current; } inline const RootIt &getCurrent() const { return current; }
inline const UnaryFunc &getFunc() const { return Fn; } inline const UnaryFunc &getFunc() const { return Fn; }
@@ -135,25 +134,47 @@ public:
return Fn(*current); // little change return Fn(*current); // little change
} }
_Self& operator++() { ++current; return *this; } mapped_iterator &operator++() {
_Self& operator--() { --current; return *this; } ++current;
_Self operator++(int) { _Self __tmp = *this; ++current; return __tmp; } return *this;
_Self operator--(int) { _Self __tmp = *this; --current; return __tmp; }
_Self operator+ (difference_type n) const {
return _Self(current + n, Fn);
} }
_Self& operator+= (difference_type n) { current += n; return *this; } mapped_iterator &operator--() {
_Self operator- (difference_type n) const { --current;
return _Self(current - n, Fn); return *this;
}
mapped_iterator operator++(int) {
mapped_iterator __tmp = *this;
++current;
return __tmp;
}
mapped_iterator operator--(int) {
mapped_iterator __tmp = *this;
--current;
return __tmp;
}
mapped_iterator operator+(difference_type n) const {
return mapped_iterator(current + n, Fn);
}
mapped_iterator &operator+=(difference_type n) {
current += n;
return *this;
}
mapped_iterator operator-(difference_type n) const {
return mapped_iterator(current - n, Fn);
}
mapped_iterator &operator-=(difference_type n) {
current -= n;
return *this;
} }
_Self& operator-= (difference_type n) { current -= n; return *this; }
reference operator[](difference_type n) const { return *(*this + n); } reference operator[](difference_type n) const { return *(*this + n); }
inline bool operator!=(const _Self &X) const { return !operator==(X); } bool operator!=(const mapped_iterator &X) const { return !operator==(X); }
inline bool operator==(const _Self &X) const { return current == X.current; } bool operator==(const mapped_iterator &X) const {
inline bool operator< (const _Self &X) const { return current < X.current; } return current == X.current;
}
bool operator<(const mapped_iterator &X) const { return current < X.current; }
inline difference_type operator-(const _Self &X) const { difference_type operator-(const mapped_iterator &X) const {
return current - X.current; return current - X.current;
} }
}; };