From 086f18626750482318612a10c3027b946b4e36e4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 2 Apr 2007 01:21:19 +0000 Subject: [PATCH] add range version of insert() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35572 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/SmallPtrSet.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/llvm/ADT/SmallPtrSet.h b/include/llvm/ADT/SmallPtrSet.h index a85b4974f89..6bd4d0927fe 100644 --- a/include/llvm/ADT/SmallPtrSet.h +++ b/include/llvm/ADT/SmallPtrSet.h @@ -90,6 +90,12 @@ public: /// was already in the set. bool insert(void *Ptr); + template + void insert(IterT I, IterT E) { + for (; I != E; ++I) + insert((void*)*I); + } + /// erase - If the set contains the specified pointer, remove it and return /// true, otherwise return false. bool erase(void *Ptr); @@ -212,8 +218,7 @@ public: template SmallPtrSet(It I, It E) : SmallPtrSetImpl(NextPowerOfTwo::Val) { - for (; I != E; ++I) - insert(*I); + insert(I, E); } typedef SmallPtrSetIterator iterator;