[llvm] r261491 - ADT: Remove ilist_iterator random access API, NFC
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 21 11:23:19 PST 2016
Author: dexonsmith
Date: Sun Feb 21 13:23:18 2016
New Revision: 261491
URL: http://llvm.org/viewvc/llvm-project?rev=261491&view=rev
Log:
ADT: Remove ilist_iterator random access API, NFC
Remove explicitly deleted random access API from ilist_iterator.
Since it no longer has implicit conversions to a pointer type, we
no longer need this protection.
Modified:
llvm/trunk/include/llvm/ADT/ilist.h
Modified: llvm/trunk/include/llvm/ADT/ilist.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist.h?rev=261491&r1=261490&r2=261491&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ilist.h (original)
+++ llvm/trunk/include/llvm/ADT/ilist.h Sun Feb 21 13:23:18 2016
@@ -204,20 +204,6 @@ public:
private:
pointer NodePtr;
- // 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:
explicit ilist_iterator(pointer NP) : NodePtr(NP) {}
@@ -283,18 +269,6 @@ public:
pointer getNodePtrUnchecked() const { return NodePtr; }
};
-// These are to catch errors when people try to use them as random access
-// iterators.
-template<typename T>
-void operator-(int, ilist_iterator<T>) = delete;
-template<typename T>
-void operator-(ilist_iterator<T>,int) = delete;
-
-template<typename T>
-void operator+(int, ilist_iterator<T>) = delete;
-template<typename T>
-void operator+(ilist_iterator<T>,int) = delete;
-
// operator!=/operator== - Allow mixed comparisons without dereferencing
// the iterator, which could very likely be pointing to end().
template<typename T>
More information about the llvm-commits
mailing list