[llvm] r260461 - Add the ability to initialize a StringSet from a pair of iterators (NFC)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 15:24:22 PST 2016


Author: mehdi_amini
Date: Wed Feb 10 17:24:21 2016
New Revision: 260461

URL: http://llvm.org/viewvc/llvm-project?rev=260461&view=rev
Log:
Add the ability to initialize a StringSet from a pair of iterators (NFC)

From: Mehdi Amini <mehdi.amini at apple.com>

Modified:
    llvm/trunk/include/llvm/ADT/StringSet.h

Modified: llvm/trunk/include/llvm/ADT/StringSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringSet.h?rev=260461&r1=260460&r2=260461&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringSet.h (original)
+++ llvm/trunk/include/llvm/ADT/StringSet.h Wed Feb 10 17:24:21 2016
@@ -33,6 +33,12 @@ namespace llvm {
       assert(!Key.empty());
       return base::insert(std::make_pair(Key, '\0'));
     }
+
+    template <typename InputIt>
+    void insert(const InputIt &Begin, const InputIt &End) {
+      for (auto It = Begin; It != End; ++It)
+        base::insert(std::make_pair(*It, '\0'));
+    }
   };
 }
 




More information about the llvm-commits mailing list