diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-09 16:54:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-09 16:54:03 +0000 |
commit | 91f0158d4d1b16b8615126b05582d421cfb14089 (patch) | |
tree | 5fd6121a7d0bcaebeb0adc5b33dbadb8c205bdfe /include/llvm/ADT/SmallPtrSet.h | |
parent | ab3fd054eac86e5eca499605ae161a25233c1909 (diff) | |
download | external_llvm-91f0158d4d1b16b8615126b05582d421cfb14089.zip external_llvm-91f0158d4d1b16b8615126b05582d421cfb14089.tar.gz external_llvm-91f0158d4d1b16b8615126b05582d421cfb14089.tar.bz2 |
implement operator= for smallptrset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38460 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/SmallPtrSet.h')
-rw-r--r-- | include/llvm/ADT/SmallPtrSet.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/ADT/SmallPtrSet.h b/include/llvm/ADT/SmallPtrSet.h index 40e9bb4..80c078f 100644 --- a/include/llvm/ADT/SmallPtrSet.h +++ b/include/llvm/ADT/SmallPtrSet.h @@ -127,6 +127,10 @@ private: /// Grow - Allocate a larger backing store for the buckets and move it over. void Grow(); + + void operator=(const SmallPtrSetImpl &RHS); // DO NOT IMPLEMENT. +protected: + void CopyFrom(const SmallPtrSetImpl &RHS); }; /// SmallPtrSetIteratorImpl - This is the common base class shared between all @@ -233,6 +237,16 @@ public: inline iterator end() const { return iterator(CurArray+CurArraySize); } + + // Allow assignment from any smallptrset with the same element type even if it + // doesn't have the same smallsize. + template<unsigned RHSSize> + const SmallPtrSet<PtrType, SmallSize> + operator=(const SmallPtrSet<PtrType, RHSSize> &RHS) { + CopyFrom(RHS); + return *this; + } + }; } |