From: Chris Lattner Date: Mon, 13 Oct 2003 15:34:17 +0000 (+0000) Subject: Add operator= for type iterators to make them assignable X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=ba7beb084c7570cc2259cb97bf8266cf4fddc03d;p=oota-llvm.git Add operator= for type iterators to make them assignable git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9083 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Type.h b/include/llvm/Type.h index fe6db028b46..91b17c0b09b 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -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); }