class SmallSet

Declaration

template <typename T, unsigned int N, typename C = std::less<T>>
class SmallSet { /* full declaration omitted */ };

Description

SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less than N). In this case, the set can be maintained with no mallocs. If the set gets large, we expand to using an std::set to maintain reasonable lookup times.

Declared at: llvm/include/llvm/ADT/SmallSet.h:136

Templates

T
unsigned int N
C = std::less<T>

Member Variables

private SmallVector<T, N> Vector
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.
private std::set<T, C> Set

Method Overview

  • public SmallSet<T, N, C>()
  • public llvm::SmallSet::const_iterator begin() const
  • public void clear()
  • public bool contains(const T & V) const
  • public llvm::SmallSet::size_type count(const T & V) const
  • public bool empty() const
  • public llvm::SmallSet::const_iterator end() const
  • public bool erase(const T & V)
  • public std::pair<NoneType, bool> insert(const T & V)
  • public template <typename IterT>void insert(IterT I, IterT E)
  • private bool isSmall() const
  • public llvm::SmallSet::size_type size() const
  • private llvm::SmallSet::VIterator vfind(const T & V) const

Methods

SmallSet<T, N, C>()

Declared at: llvm/include/llvm/ADT/SmallSet.h:155

llvm::SmallSet::const_iterator begin() const

Declared at: llvm/include/llvm/ADT/SmallSet.h:225

void clear()

Declared at: llvm/include/llvm/ADT/SmallSet.h:220

bool contains(const T& V) const

Description

Check if the SmallSet contains the given element.

Declared at: llvm/include/llvm/ADT/SmallSet.h:238

Parameters

const T& V

llvm::SmallSet::size_type count(const T& V) const

Description

count - Return 1 if the element is in the set, 0 otherwise.

Declared at: llvm/include/llvm/ADT/SmallSet.h:166

Parameters

const T& V

bool empty() const

Declared at: llvm/include/llvm/ADT/SmallSet.h:157

llvm::SmallSet::const_iterator end() const

Declared at: llvm/include/llvm/ADT/SmallSet.h:231

bool erase(const T& V)

Declared at: llvm/include/llvm/ADT/SmallSet.h:209

Parameters

const T& V

std::pair<NoneType, bool> insert(const T& V)

Description

insert - Insert an element into the set if it isn't already there. Returns true if the element is inserted (it was not in the set before). The first value of the returned pair is unused and provided for partial compatibility with the standard library self-associative container concept.

Declared at: llvm/include/llvm/ADT/SmallSet.h:182

Parameters

const T& V

template <typename IterT>
void insert(IterT I, IterT E)

Declared at: llvm/include/llvm/ADT/SmallSet.h:204

Templates

IterT

Parameters

IterT I
IterT E

bool isSmall() const

Declared at: llvm/include/llvm/ADT/SmallSet.h:245

llvm::SmallSet::size_type size() const

Declared at: llvm/include/llvm/ADT/SmallSet.h:161

llvm::SmallSet::VIterator vfind(const T& V) const

Declared at: llvm/include/llvm/ADT/SmallSet.h:247

Parameters

const T& V