Add operator= for type iterators to make them assignable
authorChris Lattner <sabre@nondot.org>
Mon, 13 Oct 2003 15:34:17 +0000 (15:34 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 13 Oct 2003 15:34:17 +0000 (15:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9083 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Type.h

index fe6db028b46f5ca9c8672cd38de350a14c6e84ea..91b17c0b09bd3bd25f4e1fbc4c34d204de4bb293 100644 (file)
@@ -250,6 +250,12 @@ private:
   public:
     TypeIterator(const Type *ty, unsigned idx) : Ty(ty), Idx(idx) {}
     ~TypeIterator() {}
+
+    const _Self &operator=(const _Self &RHS) {
+      assert(Ty == RHS.Ty && "Cannot assign from different types!");
+      Idx = RHS.Idx;
+      return *this;
+    }
     
     bool operator==(const _Self& x) const { return Idx == x.Idx; }
     bool operator!=(const _Self& x) const { return !operator==(x); }