Home | History | Annotate | Download | only in ADT

Lines Matching defs:Set

20 #include <set>
24 /// SmallSet - This maintains a set of unique values, optimizing for the case
25 /// when the set is small (less than N). In this case, the set can be
26 /// maintained with no mallocs. If the set gets large, we expand to using an
27 /// std::set to maintain reasonable lookup times.
29 /// Note that this set does not provide a way to iterate over members in the
30 /// set.
37 std::set<T, C> Set;
43 // DenseSet<> instead if you expect many elements in the set.
51 return Vector.empty() && Set.empty();
55 return isSmall() ? Vector.size() : Set.size();
58 /// count - Return 1 if the element is in the set, 0 otherwise.
64 return Set.count(V);
68 /// insert - Insert an element into the set if it isn't already there.
69 /// Returns true if the element is inserted (it was not in the set before).
77 return std::make_pair(None, Set.insert(V).second);
87 // Otherwise, grow from vector to set.
89 Set.insert(Vector.back());
92 Set.insert(V);
104 return Set.erase(V);
115 Set.clear();
119 bool isSmall() const { return Set.empty(); }
129 /// If this set is of pointer values, transparently switch over to using