14 #ifndef LLVM_ADT_SMALLSET_H
15 #define LLVM_ADT_SMALLSET_H
30 template <
typename T,
unsigned N,
typename C = std::less<T> >
42 bool empty()
const {
return Vector.empty() && Set.empty(); }
44 return isSmall() ? Vector.size() : Set.size();
51 return vfind(V) != Vector.end();
61 return Set.insert(V).second;
63 VIterator
I = vfind(V);
64 if (I != Vector.end())
66 if (Vector.size() <
N) {
72 while (!Vector.empty()) {
73 Set.insert(Vector.back());
80 template <
typename IterT>
89 for (mutable_iterator
I = Vector.begin(), E = Vector.end();
I != E; ++
I)
102 bool isSmall()
const {
return Set.empty(); }
104 VIterator vfind(
const T &V)
const {
105 for (VIterator
I = Vector.begin(), E = Vector.end();
I != E; ++
I)
114 template <
typename Po
inteeType,
unsigned N>
void insert(IterT I, IterT E)
bool count(const T &V) const
count - Return true if the element is in the set.