Standard C++ Library Reference ISO/IEC (VERSION3)
pair<iterator, bool> insert(const value_type& val);
iterator insert(iterator where, const value_type& val);
template<class InIt>
void insert(InIt first, InIt last);
iterator erase(iterator where);
iterator erase(iterator first, iterator last);
size_type erase(const Key& keyval);
void clear();
void swap(set& right);
key_compare key_comp() const;
value_compare value_comp() const;
iterator find(const Key& keyval);
const_iterator find(const Key& keyval) const;
size_type count(const Key& keyval) const;
iterator lower_bound(const Key& keyval);
const_iterator lower_bound(const Key& keyval) const;
iterator upper_bound(const Key& keyval);
const_iterator upper_bound(const Key& keyval) const;
pair<iterator, iterator> equal_range(const Key& keyval);
pair<const_iterator, const_iterator>
equal_range(const Key& keyval) const;
};
The template class describes an object that controls a varying-length sequence of elements of
type const Key. The sequence is ordered by the predicate Pr. Each element serves as both a
sort key and a value. The sequence is represented in a way that permits lookup, insertion, and
removal of an arbitrary element with a number of operations proportional to the logarithm of
the number of elements in the sequence (logarithmic time). Moreover, inserting an element
invalidates no iterators, and removing an element invalidates only those iterators which point at
the removed element.
The object orders the sequence it controls by calling a stored function object of type Pr. You
access this stored object by calling the member function key_comp(). Such a function object
must impose a strict weak ordering on sort keys of type Key. For any element X that precedes Y
in the sequence, key_comp()(Y, X) is false. (For the default function object less<Key>,
sort keys never decrease in value.) Unlike template class multiset, an object of template
class set ensures that key_comp()(X, Y) is true. (Each key is unique.)
The object allocates and frees storage for the sequence it controls through a stored allocator
object of class Alloc. Such an allocator object must have the same external interface as an
object of template class allocator. Note that the stored allocator object is not copied when
the container object is assigned.