llvm.org GIT mirror llvm / 3d4227b
Fix several places that called mapped_iterator's constructor without passing in a function object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57615 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 11 years ago
1 changed file(s) with 8 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
7272 typedef mapped_iterator _Self;
7373
7474 inline const RootIt &getCurrent() const { return current; }
75 inline const UnaryFunc &getFunc() const { return Fn; }
7576
7677 inline explicit mapped_iterator(const RootIt &I, UnaryFunc F)
7778 : current(I), Fn(F) {}
8687 _Self& operator--() { --current; return *this; }
8788 _Self operator++(int) { _Self __tmp = *this; ++current; return __tmp; }
8889 _Self operator--(int) { _Self __tmp = *this; --current; return __tmp; }
89 _Self operator+ (difference_type n) const { return _Self(current + n); }
90 _Self operator+ (difference_type n) const {
91 return _Self(current + n, Fn);
92 }
9093 _Self& operator+= (difference_type n) { current += n; return *this; }
91 _Self operator- (difference_type n) const { return _Self(current - n); }
94 _Self operator- (difference_type n) const {
95 return _Self(current - n, Fn);
96 }
9297 _Self& operator-= (difference_type n) { current -= n; return *this; }
9398 reference operator[](difference_type n) const { return *(*this + n); }
9499
105110 inline mapped_iterator<_Iterator, Func>
106111 operator+(typename mapped_iterator<_Iterator, Func>::difference_type N,
107112 const mapped_iterator<_Iterator, Func>& X) {
108 return mapped_iterator<_Iterator, Func>(X.getCurrent() - N);
113 return mapped_iterator<_Iterator, Func>(X.getCurrent() - N, X.getFunc());
109114 }
110115
111116