From: Chris Lattner Date: Sun, 4 Mar 2007 04:04:43 +0000 (+0000) Subject: add iterator range version of ctor. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ab8fea5283de0931e1da5dc91b4df2f734ba0206;p=oota-llvm.git add iterator range version of ctor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34899 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/SmallPtrSet.h b/include/llvm/ADT/SmallPtrSet.h index f77eb7d8ca7..a85b4974f89 100644 --- a/include/llvm/ADT/SmallPtrSet.h +++ b/include/llvm/ADT/SmallPtrSet.h @@ -209,6 +209,13 @@ class SmallPtrSet : public SmallPtrSetImpl { public: SmallPtrSet() : SmallPtrSetImpl(NextPowerOfTwo::Val) {} + template + SmallPtrSet(It I, It E) + : SmallPtrSetImpl(NextPowerOfTwo::Val) { + for (; I != E; ++I) + insert(*I); + } + typedef SmallPtrSetIterator iterator; typedef SmallPtrSetIterator const_iterator; inline iterator begin() const {