diff --git a/libcxx/test/support/test_iterators.h b/libcxx/test/support/test_iterators.h index b91653dc9ff1..e09fd834d215 100644 --- a/libcxx/test/support/test_iterators.h +++ b/libcxx/test/support/test_iterators.h @@ -306,108 +306,6 @@ operator-(const random_access_iterator& x, const random_access_iterator& y return x.base() - y.base(); } -template -class comma_iterator -{ - It it_; - - template friend class comma_iterator; -public: - typedef std::random_access_iterator_tag iterator_category; - typedef typename std::iterator_traits::value_type value_type; - typedef typename std::iterator_traits::difference_type difference_type; - typedef It pointer; - typedef typename std::iterator_traits::reference reference; - - It base() const {return it_;} - - comma_iterator() : it_() {} - explicit comma_iterator(It it) : it_(it) {} - template - comma_iterator(const comma_iterator& u) :it_(u.it_) {} - - reference operator*() const {return *it_;} - pointer operator->() const {return it_;} - - comma_iterator& operator++() {++it_; return *this;} - comma_iterator operator++(int) - {comma_iterator tmp(*this); ++(*this); return tmp;} - - comma_iterator& operator--() {--it_; return *this;} - comma_iterator operator--(int) - {comma_iterator tmp(*this); --(*this); return tmp;} - - comma_iterator& operator+=(difference_type n) {it_ += n; return *this;} - comma_iterator operator+(difference_type n) const - {comma_iterator tmp(*this); tmp += n; return tmp;} - friend comma_iterator operator+(difference_type n, comma_iterator x) - {x += n; return x;} - comma_iterator& operator-=(difference_type n) {return *this += -n;} - comma_iterator operator-(difference_type n) const - {comma_iterator tmp(*this); tmp -= n; return tmp;} - - reference operator[](difference_type n) const {return it_[n];} - template - void operator,(const T &) { assert(false); } -}; - -template -inline -bool -operator==(const comma_iterator& x, const comma_iterator& y) -{ - return x.base() == y.base(); -} - -template -inline -bool -operator!=(const comma_iterator& x, const comma_iterator& y) -{ - return !(x == y); -} - -template -inline -bool -operator<(const comma_iterator& x, const comma_iterator& y) -{ - return x.base() < y.base(); -} - -template -inline -bool -operator<=(const comma_iterator& x, const comma_iterator& y) -{ - return !(y < x); -} - -template -inline -bool -operator>(const comma_iterator& x, const comma_iterator& y) -{ - return y < x; -} - -template -inline -bool -operator>=(const comma_iterator& x, const comma_iterator& y) -{ - return !(x < y); -} - -template -inline -typename std::iterator_traits::difference_type -operator-(const comma_iterator& x, const comma_iterator& y) -{ - return x.base() - y.base(); -} - - template inline Iter base(output_iterator i) { return i.base(); } @@ -423,9 +321,6 @@ inline Iter base(bidirectional_iterator i) { return i.base(); } template inline Iter base(random_access_iterator i) { return i.base(); } -template -inline Iter base(comma_iterator i) { return i.base(); } - template // everything else inline Iter base(Iter i) { return i; }