summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-01-04 03:22:42 +0000
committerDan Gohman <gohman@apple.com>2009-01-04 03:22:42 +0000
commita0979b24d39d88f8240056110f201dbf98d7b703 (patch)
treefecb63461e8e5899a269651407cb852a4cdd6a26 /llvm
parent762e162284e0633e3a006c589812d168189b9a2e (diff)
downloadbcm5719-llvm-a0979b24d39d88f8240056110f201dbf98d7b703.tar.gz
bcm5719-llvm-a0979b24d39d88f8240056110f201dbf98d7b703.zip
Add several more unimplemented operator overloads to ilist_iterator
to help catch errors. llvm-svn: 61622
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/ADT/ilist.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/llvm/include/llvm/ADT/ilist.h b/llvm/include/llvm/ADT/ilist.h
index ea4ca430d5c..0acbf46a1aa 100644
--- a/llvm/include/llvm/ADT/ilist.h
+++ b/llvm/include/llvm/ADT/ilist.h
@@ -107,15 +107,27 @@ public:
typedef ilist_traits<NodeTy> Traits;
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::reference reference;
private:
pointer NodePtr;
- // operator[] is not defined. Compile error instead of having a runtime bug.
- void operator[](unsigned) {}
- void operator[](unsigned) const {}
+ // ilist_iterator is not a random-access iterator, but it has an
+ // implicit conversion to pointer-type, which is. Declare (but
+ // 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:
ilist_iterator(pointer NP) : NodePtr(NP) {}
OpenPOWER on IntegriCloud