Removed several more different 'iterators.h' files in libcxx/test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@171452 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
002a984948
commit
ba1920fe4b
@ -17,7 +17,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@ -1,251 +0,0 @@
|
|||||||
#ifndef ITERATORS_H
|
|
||||||
#define ITERATORS_H
|
|
||||||
|
|
||||||
#include <iterator>
|
|
||||||
|
|
||||||
template <class It>
|
|
||||||
class input_iterator
|
|
||||||
{
|
|
||||||
It it_;
|
|
||||||
|
|
||||||
template <class U> friend class input_iterator;
|
|
||||||
public:
|
|
||||||
typedef std::input_iterator_tag iterator_category;
|
|
||||||
typedef typename std::iterator_traits<It>::value_type value_type;
|
|
||||||
typedef typename std::iterator_traits<It>::difference_type difference_type;
|
|
||||||
typedef It pointer;
|
|
||||||
typedef typename std::iterator_traits<It>::reference reference;
|
|
||||||
|
|
||||||
It base() const {return it_;}
|
|
||||||
|
|
||||||
input_iterator() : it_() {}
|
|
||||||
explicit input_iterator(It it) : it_(it) {}
|
|
||||||
template <class U>
|
|
||||||
input_iterator(const input_iterator<U>& u) :it_(u.it_) {}
|
|
||||||
|
|
||||||
reference operator*() const {return *it_;}
|
|
||||||
pointer operator->() const {return it_;}
|
|
||||||
|
|
||||||
input_iterator& operator++() {++it_; return *this;}
|
|
||||||
input_iterator operator++(int)
|
|
||||||
{input_iterator tmp(*this); ++(*this); return tmp;}
|
|
||||||
|
|
||||||
friend bool operator==(const input_iterator& x, const input_iterator& y)
|
|
||||||
{return x.it_ == y.it_;}
|
|
||||||
friend bool operator!=(const input_iterator& x, const input_iterator& y)
|
|
||||||
{return !(x == y);}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator==(const input_iterator<T>& x, const input_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return x.base() == y.base();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator!=(const input_iterator<T>& x, const input_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return !(x == y);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class It>
|
|
||||||
class forward_iterator
|
|
||||||
{
|
|
||||||
It it_;
|
|
||||||
|
|
||||||
template <class U> friend class forward_iterator;
|
|
||||||
public:
|
|
||||||
typedef std::forward_iterator_tag iterator_category;
|
|
||||||
typedef typename std::iterator_traits<It>::value_type value_type;
|
|
||||||
typedef typename std::iterator_traits<It>::difference_type difference_type;
|
|
||||||
typedef It pointer;
|
|
||||||
typedef typename std::iterator_traits<It>::reference reference;
|
|
||||||
|
|
||||||
It base() const {return it_;}
|
|
||||||
|
|
||||||
forward_iterator() : it_() {}
|
|
||||||
explicit forward_iterator(It it) : it_(it) {}
|
|
||||||
template <class U>
|
|
||||||
forward_iterator(const forward_iterator<U>& u) :it_(u.it_) {}
|
|
||||||
|
|
||||||
reference operator*() const {return *it_;}
|
|
||||||
pointer operator->() const {return it_;}
|
|
||||||
|
|
||||||
forward_iterator& operator++() {++it_; return *this;}
|
|
||||||
forward_iterator operator++(int)
|
|
||||||
{forward_iterator tmp(*this); ++(*this); return tmp;}
|
|
||||||
|
|
||||||
friend bool operator==(const forward_iterator& x, const forward_iterator& y)
|
|
||||||
{return x.it_ == y.it_;}
|
|
||||||
friend bool operator!=(const forward_iterator& x, const forward_iterator& y)
|
|
||||||
{return !(x == y);}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator==(const forward_iterator<T>& x, const forward_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return x.base() == y.base();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator!=(const forward_iterator<T>& x, const forward_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return !(x == y);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class It>
|
|
||||||
class bidirectional_iterator
|
|
||||||
{
|
|
||||||
It it_;
|
|
||||||
|
|
||||||
template <class U> friend class bidirectional_iterator;
|
|
||||||
public:
|
|
||||||
typedef std::bidirectional_iterator_tag iterator_category;
|
|
||||||
typedef typename std::iterator_traits<It>::value_type value_type;
|
|
||||||
typedef typename std::iterator_traits<It>::difference_type difference_type;
|
|
||||||
typedef It pointer;
|
|
||||||
typedef typename std::iterator_traits<It>::reference reference;
|
|
||||||
|
|
||||||
It base() const {return it_;}
|
|
||||||
|
|
||||||
bidirectional_iterator() : it_() {}
|
|
||||||
explicit bidirectional_iterator(It it) : it_(it) {}
|
|
||||||
template <class U>
|
|
||||||
bidirectional_iterator(const bidirectional_iterator<U>& u) :it_(u.it_) {}
|
|
||||||
|
|
||||||
reference operator*() const {return *it_;}
|
|
||||||
pointer operator->() const {return it_;}
|
|
||||||
|
|
||||||
bidirectional_iterator& operator++() {++it_; return *this;}
|
|
||||||
bidirectional_iterator operator++(int)
|
|
||||||
{bidirectional_iterator tmp(*this); ++(*this); return tmp;}
|
|
||||||
|
|
||||||
bidirectional_iterator& operator--() {--it_; return *this;}
|
|
||||||
bidirectional_iterator operator--(int)
|
|
||||||
{bidirectional_iterator tmp(*this); --(*this); return tmp;}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator==(const bidirectional_iterator<T>& x, const bidirectional_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return x.base() == y.base();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator!=(const bidirectional_iterator<T>& x, const bidirectional_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return !(x == y);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class It>
|
|
||||||
class random_access_iterator
|
|
||||||
{
|
|
||||||
It it_;
|
|
||||||
|
|
||||||
template <class U> friend class random_access_iterator;
|
|
||||||
public:
|
|
||||||
typedef std::random_access_iterator_tag iterator_category;
|
|
||||||
typedef typename std::iterator_traits<It>::value_type value_type;
|
|
||||||
typedef typename std::iterator_traits<It>::difference_type difference_type;
|
|
||||||
typedef It pointer;
|
|
||||||
typedef typename std::iterator_traits<It>::reference reference;
|
|
||||||
|
|
||||||
It base() const {return it_;}
|
|
||||||
|
|
||||||
random_access_iterator() : it_() {}
|
|
||||||
explicit random_access_iterator(It it) : it_(it) {}
|
|
||||||
template <class U>
|
|
||||||
random_access_iterator(const random_access_iterator<U>& u) :it_(u.it_) {}
|
|
||||||
|
|
||||||
reference operator*() const {return *it_;}
|
|
||||||
pointer operator->() const {return it_;}
|
|
||||||
|
|
||||||
random_access_iterator& operator++() {++it_; return *this;}
|
|
||||||
random_access_iterator operator++(int)
|
|
||||||
{random_access_iterator tmp(*this); ++(*this); return tmp;}
|
|
||||||
|
|
||||||
random_access_iterator& operator--() {--it_; return *this;}
|
|
||||||
random_access_iterator operator--(int)
|
|
||||||
{random_access_iterator tmp(*this); --(*this); return tmp;}
|
|
||||||
|
|
||||||
random_access_iterator& operator+=(difference_type n) {it_ += n; return *this;}
|
|
||||||
random_access_iterator operator+(difference_type n) const
|
|
||||||
{random_access_iterator tmp(*this); tmp += n; return tmp;}
|
|
||||||
friend random_access_iterator operator+(difference_type n, random_access_iterator x)
|
|
||||||
{x += n; return x;}
|
|
||||||
random_access_iterator& operator-=(difference_type n) {return *this += -n;}
|
|
||||||
random_access_iterator operator-(difference_type n) const
|
|
||||||
{random_access_iterator tmp(*this); tmp -= n; return tmp;}
|
|
||||||
|
|
||||||
reference operator[](difference_type n) const {return it_[n];}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator==(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return x.base() == y.base();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator!=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return !(x == y);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator<(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return x.base() < y.base();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator<=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return !(y < x);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator>(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return y < x;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator>=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return !(x < y);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
typename std::iterator_traits<T>::difference_type
|
|
||||||
operator-(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return x.base() - y.base();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // ITERATORS_H
|
|
@ -15,7 +15,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
std::deque<int>
|
std::deque<int>
|
||||||
make(int size, int start = 0 )
|
make(int size, int start = 0 )
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
std::deque<int>
|
std::deque<int>
|
||||||
make(int size, int start = 0 )
|
make(int size, int start = 0 )
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../stack_allocator.h"
|
#include "../../../stack_allocator.h"
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
template <class InputIterator>
|
template <class InputIterator>
|
||||||
void
|
void
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
|
|
||||||
template <class InputIterator, class Allocator>
|
template <class InputIterator, class Allocator>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../MoveOnly.h"
|
#include "../../../MoveOnly.h"
|
||||||
#include "../../../stack_allocator.h"
|
#include "../../../stack_allocator.h"
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
std::deque<int>
|
std::deque<int>
|
||||||
make(int size, int start = 0 )
|
make(int size, int start = 0 )
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
std::deque<int>
|
std::deque<int>
|
||||||
make(int size, int start = 0 )
|
make(int size, int start = 0 )
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
std::deque<int>
|
std::deque<int>
|
||||||
make(int size, int start = 0 )
|
make(int size, int start = 0 )
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
std::deque<int>
|
std::deque<int>
|
||||||
make(int size, int start = 0 )
|
make(int size, int start = 0 )
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <forward_list>
|
#include <forward_list>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../stack_allocator.h"
|
#include "../../../stack_allocator.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "../../../iterators.h"
|
||||||
|
|
||||||
template <class C, class Iterator>
|
template <class C, class Iterator>
|
||||||
void
|
void
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "../../../iterators.h"
|
||||||
|
|
||||||
template <class C, class Iterator>
|
template <class C, class Iterator>
|
||||||
void
|
void
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include "../../iterators.h"
|
#include "../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../stack_allocator.h"
|
#include "../../../stack_allocator.h"
|
||||||
|
|
||||||
template <class C, class Iterator>
|
template <class C, class Iterator>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../stack_allocator.h"
|
#include "../../../stack_allocator.h"
|
||||||
|
|
||||||
template <class C, class Iterator>
|
template <class C, class Iterator>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include "../../../stack_allocator.h"
|
#include "../../../stack_allocator.h"
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../NotConstructible.h"
|
#include "../../../NotConstructible.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../NotConstructible.h"
|
#include "../../../NotConstructible.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../NotConstructible.h"
|
#include "../../../NotConstructible.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../NotConstructible.h"
|
#include "../../../NotConstructible.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../NotConstructible.h"
|
#include "../../../NotConstructible.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../NotConstructible.h"
|
#include "../../../NotConstructible.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../NotConstructible.h"
|
#include "../../../NotConstructible.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../NotConstructible.h"
|
#include "../../../NotConstructible.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../NotConstructible.h"
|
#include "../../../NotConstructible.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../NotConstructible.h"
|
#include "../../../NotConstructible.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "../../../iterators.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
#include "../../../test_compare.h"
|
#include "../../../test_compare.h"
|
||||||
#include "../../../test_hash.h"
|
#include "../../../test_hash.h"
|
||||||
#include "../../../test_allocator.h"
|
#include "../../../test_allocator.h"
|
||||||
|
@ -18,6 +18,7 @@ public:
|
|||||||
|
|
||||||
It base() const {return it_;}
|
It base() const {return it_;}
|
||||||
|
|
||||||
|
output_iterator () {}
|
||||||
explicit output_iterator(It it) : it_(it) {}
|
explicit output_iterator(It it) : it_(it) {}
|
||||||
template <class U>
|
template <class U>
|
||||||
output_iterator(const output_iterator<U>& u) :it_(u.it_) {}
|
output_iterator(const output_iterator<U>& u) :it_(u.it_) {}
|
@ -21,7 +21,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -1,251 +0,0 @@
|
|||||||
#ifndef ITERATORS_H
|
|
||||||
#define ITERATORS_H
|
|
||||||
|
|
||||||
#include <iterator>
|
|
||||||
|
|
||||||
template <class It>
|
|
||||||
class input_iterator
|
|
||||||
{
|
|
||||||
It it_;
|
|
||||||
|
|
||||||
template <class U> friend class input_iterator;
|
|
||||||
public:
|
|
||||||
typedef std::input_iterator_tag iterator_category;
|
|
||||||
typedef typename std::iterator_traits<It>::value_type value_type;
|
|
||||||
typedef typename std::iterator_traits<It>::difference_type difference_type;
|
|
||||||
typedef It pointer;
|
|
||||||
typedef typename std::iterator_traits<It>::reference reference;
|
|
||||||
|
|
||||||
It base() const {return it_;}
|
|
||||||
|
|
||||||
input_iterator() : it_() {}
|
|
||||||
explicit input_iterator(It it) : it_(it) {}
|
|
||||||
template <class U>
|
|
||||||
input_iterator(const input_iterator<U>& u) :it_(u.it_) {}
|
|
||||||
|
|
||||||
reference operator*() const {return *it_;}
|
|
||||||
pointer operator->() const {return it_;}
|
|
||||||
|
|
||||||
input_iterator& operator++() {++it_; return *this;}
|
|
||||||
input_iterator operator++(int)
|
|
||||||
{input_iterator tmp(*this); ++(*this); return tmp;}
|
|
||||||
|
|
||||||
friend bool operator==(const input_iterator& x, const input_iterator& y)
|
|
||||||
{return x.it_ == y.it_;}
|
|
||||||
friend bool operator!=(const input_iterator& x, const input_iterator& y)
|
|
||||||
{return !(x == y);}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator==(const input_iterator<T>& x, const input_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return x.base() == y.base();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator!=(const input_iterator<T>& x, const input_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return !(x == y);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class It>
|
|
||||||
class forward_iterator
|
|
||||||
{
|
|
||||||
It it_;
|
|
||||||
|
|
||||||
template <class U> friend class forward_iterator;
|
|
||||||
public:
|
|
||||||
typedef std::forward_iterator_tag iterator_category;
|
|
||||||
typedef typename std::iterator_traits<It>::value_type value_type;
|
|
||||||
typedef typename std::iterator_traits<It>::difference_type difference_type;
|
|
||||||
typedef It pointer;
|
|
||||||
typedef typename std::iterator_traits<It>::reference reference;
|
|
||||||
|
|
||||||
It base() const {return it_;}
|
|
||||||
|
|
||||||
forward_iterator() : it_() {}
|
|
||||||
explicit forward_iterator(It it) : it_(it) {}
|
|
||||||
template <class U>
|
|
||||||
forward_iterator(const forward_iterator<U>& u) :it_(u.it_) {}
|
|
||||||
|
|
||||||
reference operator*() const {return *it_;}
|
|
||||||
pointer operator->() const {return it_;}
|
|
||||||
|
|
||||||
forward_iterator& operator++() {++it_; return *this;}
|
|
||||||
forward_iterator operator++(int)
|
|
||||||
{forward_iterator tmp(*this); ++(*this); return tmp;}
|
|
||||||
|
|
||||||
friend bool operator==(const forward_iterator& x, const forward_iterator& y)
|
|
||||||
{return x.it_ == y.it_;}
|
|
||||||
friend bool operator!=(const forward_iterator& x, const forward_iterator& y)
|
|
||||||
{return !(x == y);}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator==(const forward_iterator<T>& x, const forward_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return x.base() == y.base();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator!=(const forward_iterator<T>& x, const forward_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return !(x == y);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class It>
|
|
||||||
class bidirectional_iterator
|
|
||||||
{
|
|
||||||
It it_;
|
|
||||||
|
|
||||||
template <class U> friend class bidirectional_iterator;
|
|
||||||
public:
|
|
||||||
typedef std::bidirectional_iterator_tag iterator_category;
|
|
||||||
typedef typename std::iterator_traits<It>::value_type value_type;
|
|
||||||
typedef typename std::iterator_traits<It>::difference_type difference_type;
|
|
||||||
typedef It pointer;
|
|
||||||
typedef typename std::iterator_traits<It>::reference reference;
|
|
||||||
|
|
||||||
It base() const {return it_;}
|
|
||||||
|
|
||||||
bidirectional_iterator() : it_() {}
|
|
||||||
explicit bidirectional_iterator(It it) : it_(it) {}
|
|
||||||
template <class U>
|
|
||||||
bidirectional_iterator(const bidirectional_iterator<U>& u) :it_(u.it_) {}
|
|
||||||
|
|
||||||
reference operator*() const {return *it_;}
|
|
||||||
pointer operator->() const {return it_;}
|
|
||||||
|
|
||||||
bidirectional_iterator& operator++() {++it_; return *this;}
|
|
||||||
bidirectional_iterator operator++(int)
|
|
||||||
{bidirectional_iterator tmp(*this); ++(*this); return tmp;}
|
|
||||||
|
|
||||||
bidirectional_iterator& operator--() {--it_; return *this;}
|
|
||||||
bidirectional_iterator operator--(int)
|
|
||||||
{bidirectional_iterator tmp(*this); --(*this); return tmp;}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator==(const bidirectional_iterator<T>& x, const bidirectional_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return x.base() == y.base();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator!=(const bidirectional_iterator<T>& x, const bidirectional_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return !(x == y);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class It>
|
|
||||||
class random_access_iterator
|
|
||||||
{
|
|
||||||
It it_;
|
|
||||||
|
|
||||||
template <class U> friend class random_access_iterator;
|
|
||||||
public:
|
|
||||||
typedef std::random_access_iterator_tag iterator_category;
|
|
||||||
typedef typename std::iterator_traits<It>::value_type value_type;
|
|
||||||
typedef typename std::iterator_traits<It>::difference_type difference_type;
|
|
||||||
typedef It pointer;
|
|
||||||
typedef typename std::iterator_traits<It>::reference reference;
|
|
||||||
|
|
||||||
It base() const {return it_;}
|
|
||||||
|
|
||||||
random_access_iterator() : it_() {}
|
|
||||||
explicit random_access_iterator(It it) : it_(it) {}
|
|
||||||
template <class U>
|
|
||||||
random_access_iterator(const random_access_iterator<U>& u) :it_(u.it_) {}
|
|
||||||
|
|
||||||
reference operator*() const {return *it_;}
|
|
||||||
pointer operator->() const {return it_;}
|
|
||||||
|
|
||||||
random_access_iterator& operator++() {++it_; return *this;}
|
|
||||||
random_access_iterator operator++(int)
|
|
||||||
{random_access_iterator tmp(*this); ++(*this); return tmp;}
|
|
||||||
|
|
||||||
random_access_iterator& operator--() {--it_; return *this;}
|
|
||||||
random_access_iterator operator--(int)
|
|
||||||
{random_access_iterator tmp(*this); --(*this); return tmp;}
|
|
||||||
|
|
||||||
random_access_iterator& operator+=(difference_type n) {it_ += n; return *this;}
|
|
||||||
random_access_iterator operator+(difference_type n) const
|
|
||||||
{random_access_iterator tmp(*this); tmp += n; return tmp;}
|
|
||||||
friend random_access_iterator operator+(difference_type n, random_access_iterator x)
|
|
||||||
{x += n; return x;}
|
|
||||||
random_access_iterator& operator-=(difference_type n) {return *this += -n;}
|
|
||||||
random_access_iterator operator-(difference_type n) const
|
|
||||||
{random_access_iterator tmp(*this); tmp -= n; return tmp;}
|
|
||||||
|
|
||||||
reference operator[](difference_type n) const {return it_[n];}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator==(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return x.base() == y.base();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator!=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return !(x == y);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator<(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return x.base() < y.base();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator<=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return !(y < x);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator>(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return y < x;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
bool
|
|
||||||
operator>=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return !(x < y);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class U>
|
|
||||||
inline
|
|
||||||
typename std::iterator_traits<T>::difference_type
|
|
||||||
operator-(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
|
||||||
{
|
|
||||||
return x.base() - y.base();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // ITERATORS_H
|
|
@ -18,7 +18,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It, class U>
|
template <class It, class U>
|
||||||
void
|
void
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It, class U>
|
template <class It, class U>
|
||||||
void
|
void
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#include "../../../iterators.h"
|
#include "../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It, class U>
|
template <class It, class U>
|
||||||
void
|
void
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../../iterators.h"
|
#include "../../../../../iterators.h"
|
||||||
|
|
||||||
template <class It>
|
template <class It>
|
||||||
void
|
void
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user