add iterator range version of ctor.
authorChris Lattner <sabre@nondot.org>
Sun, 4 Mar 2007 04:04:43 +0000 (04:04 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 4 Mar 2007 04:04:43 +0000 (04:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34899 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/SmallPtrSet.h

index f77eb7d8ca71009b8d68e7e6b955c282726ceae9..a85b4974f89b4338caea0b101a0cbacea8f61425 100644 (file)
@@ -209,6 +209,13 @@ class SmallPtrSet : public SmallPtrSetImpl {
 public:
   SmallPtrSet() : SmallPtrSetImpl(NextPowerOfTwo<SmallSizePowTwo>::Val) {}
   
+  template<typename It>
+  SmallPtrSet(It I, It E)
+    : SmallPtrSetImpl(NextPowerOfTwo<SmallSizePowTwo>::Val) {
+    for (; I != E; ++I)
+      insert(*I);
+  }
+  
   typedef SmallPtrSetIterator<PtrType> iterator;
   typedef SmallPtrSetIterator<PtrType> const_iterator;
   inline iterator begin() const {