forked from OSchip/llvm-project
Add several more unimplemented operator overloads to ilist_iterator
to help catch errors. llvm-svn: 61622
This commit is contained in:
parent
762e162284
commit
a0979b24d3
|
@ -107,15 +107,27 @@ public:
|
||||||
typedef ilist_traits<NodeTy> Traits;
|
typedef ilist_traits<NodeTy> Traits;
|
||||||
typedef bidirectional_iterator<NodeTy, ptrdiff_t> super;
|
typedef bidirectional_iterator<NodeTy, ptrdiff_t> super;
|
||||||
|
|
||||||
typedef size_t size_type;
|
typedef typename super::value_type value_type;
|
||||||
|
typedef typename super::difference_type difference_type;
|
||||||
typedef typename super::pointer pointer;
|
typedef typename super::pointer pointer;
|
||||||
typedef typename super::reference reference;
|
typedef typename super::reference reference;
|
||||||
private:
|
private:
|
||||||
pointer NodePtr;
|
pointer NodePtr;
|
||||||
|
|
||||||
// operator[] is not defined. Compile error instead of having a runtime bug.
|
// ilist_iterator is not a random-access iterator, but it has an
|
||||||
void operator[](unsigned) {}
|
// implicit conversion to pointer-type, which is. Declare (but
|
||||||
void operator[](unsigned) const {}
|
// don't define) these functions as private to help catch
|
||||||
|
// accidental misuse.
|
||||||
|
void operator[](difference_type) const;
|
||||||
|
void operator+(difference_type) const;
|
||||||
|
void operator-(difference_type) const;
|
||||||
|
void operator+=(difference_type) const;
|
||||||
|
void operator-=(difference_type) const;
|
||||||
|
template<class T> void operator<(T) const;
|
||||||
|
template<class T> void operator<=(T) const;
|
||||||
|
template<class T> void operator>(T) const;
|
||||||
|
template<class T> void operator>=(T) const;
|
||||||
|
template<class T> void operator-(T) const;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ilist_iterator(pointer NP) : NodePtr(NP) {}
|
ilist_iterator(pointer NP) : NodePtr(NP) {}
|
||||||
|
|
Loading…
Reference in New Issue