From ab8fea5283de0931e1da5dc91b4df2f734ba0206 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 4 Mar 2007 04:04:43 +0000 Subject: [PATCH] add iterator range version of ctor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34899 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/SmallPtrSet.h | 7 +++++++ 1 file changed, 7 insertions(+) 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 {