summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-01-05 17:35:07 +0000
committerChris Lattner <sabre@nondot.org>2012-01-05 17:35:07 +0000
commit8ff6bc924fbff00b63b84a8bd00cb0fd85265087 (patch)
treee51d782bfea7220c6f25eb746403f3c2f9df11a7
parenteab50299641b8ad51984bc1474f028b7103111fc (diff)
downloadbcm5719-llvm-8ff6bc924fbff00b63b84a8bd00cb0fd85265087.tar.gz
bcm5719-llvm-8ff6bc924fbff00b63b84a8bd00cb0fd85265087.zip
allow clients of SmallSet to specify their own comparison function for the set.
Patch by Stepan Dyatkovskiy! llvm-svn: 147607
-rw-r--r--llvm/include/llvm/ADT/SmallSet.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/include/llvm/ADT/SmallSet.h b/llvm/include/llvm/ADT/SmallSet.h
index d03f1bef15b..cd117f59ba7 100644
--- a/llvm/include/llvm/ADT/SmallSet.h
+++ b/llvm/include/llvm/ADT/SmallSet.h
@@ -27,13 +27,13 @@ namespace llvm {
///
/// 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:
OpenPOWER on IntegriCloud