Add global methods that prevent us from using ilist::iterators as
authorAlkis Evlogimenos <alkis@evlogimenos.com>
Mon, 9 Feb 2004 22:40:50 +0000 (22:40 +0000)
committerAlkis Evlogimenos <alkis@evlogimenos.com>
Mon, 9 Feb 2004 22:40:50 +0000 (22:40 +0000)
random access iterators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11248 91177308-0d34-0410-b5e6-96231b3b80d8

include/Support/ilist
include/llvm/ADT/ilist

index fda57c5fa799c72a20010bc68ee127910821b8e0..bfa601f9c9f9281b56d3b50ded704ee59e1a27bb 100644 (file)
@@ -156,6 +156,18 @@ public:
   pointer getNodePtrUnchecked() const { return NodePtr; }
 };
 
+// do not implement. this is to catch errors when people try to use
+// them as random access iterators
+template<typename T>
+void operator-(int, ilist_iterator<T>);
+template<typename T>
+void operator-(ilist_iterator<T>,int);
+
+template<typename T>
+void operator+(int, ilist_iterator<T>);
+template<typename T>
+void operator+(ilist_iterator<T>,int);
+
 //===----------------------------------------------------------------------===//
 // ilist_compat_iterator<Node> - Compatibility iterator for intrusive list.
 // This makes an ilist<X> act like an std::list<X*>, where you have to
index fda57c5fa799c72a20010bc68ee127910821b8e0..bfa601f9c9f9281b56d3b50ded704ee59e1a27bb 100644 (file)
@@ -156,6 +156,18 @@ public:
   pointer getNodePtrUnchecked() const { return NodePtr; }
 };
 
+// do not implement. this is to catch errors when people try to use
+// them as random access iterators
+template<typename T>
+void operator-(int, ilist_iterator<T>);
+template<typename T>
+void operator-(ilist_iterator<T>,int);
+
+template<typename T>
+void operator+(int, ilist_iterator<T>);
+template<typename T>
+void operator+(ilist_iterator<T>,int);
+
 //===----------------------------------------------------------------------===//
 // ilist_compat_iterator<Node> - Compatibility iterator for intrusive list.
 // This makes an ilist<X> act like an std::list<X*>, where you have to