[llvm-commits] [llvm] r147607 - /llvm/trunk/include/llvm/ADT/SmallSet.h

Chris Lattner sabre at nondot.org
Thu Jan 5 09:35:07 PST 2012


Author: lattner
Date: Thu Jan  5 11:35:07 2012
New Revision: 147607

URL: http://llvm.org/viewvc/llvm-project?rev=147607&view=rev
Log:
allow clients of SmallSet to specify their own comparison function for the set.
Patch by Stepan Dyatkovskiy!

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

Modified: llvm/trunk/include/llvm/ADT/SmallSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallSet.h?rev=147607&r1=147606&r2=147607&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SmallSet.h (original)
+++ llvm/trunk/include/llvm/ADT/SmallSet.h Thu Jan  5 11:35:07 2012
@@ -27,13 +27,13 @@
 ///
 /// Note that this set does not provide a way to iterate over members in the
 /// set.
-template <typename T, unsigned N>
+template <typename T, unsigned N,  typename C = std::less<T> >
 class SmallSet {
   /// Use a SmallVector to hold the elements here (even though it will never
   /// reach its 'large' stage) to avoid calling the default ctors of elements
   /// we will never use.
   SmallVector<T, N> Vector;
-  std::set<T> Set;
+  std::set<T, C> Set;
   typedef typename SmallVector<T, N>::const_iterator VIterator;
   typedef typename SmallVector<T, N>::iterator mutable_iterator;
 public:





More information about the llvm-commits mailing list