Standard C++ Library Class Reference

Returns an iterator that points to the past-the-end value.
const_iterator end () const;
Returns a const_iterator that points to the past-the-end value.
reverse_iterator rbegin ();
Returns a reverse_iterator that points to the past-the-end value.
const_reverse_iterator rbegin () const;
Returns a const_reverse_iterator that points to the past-the-end value.
reverse_iterator rend ();
Returns a reverse_iterator that points to the first element.
const_reverse_iterator rend () const;
Returns a const_reverse_iterator that points to the first element.
Member Functions
void
clear ();
Erases all elements from the set.
size_type
count (const key_type& x) const;
Returns the number of elements equal to x. Since a set supports unique keys, count will always
return 1 or 0.
bool
empty () const;
Returns true if the size is zero.
pair<iterator, iterator>
equal_range (const key_type& x) const;
Returns pair(lower_bound(x),upper_bound(x)). The equal_range function indicates the valid
range for insertion of x into the set.
size_type
erase (const key_type& x);
Deletes all the elements matching x. Returns the number of elements erased. Since a set supports
unique keys, erase will always return 1 or 0.
iterator
erase (iterator position);
Deletes the map element pointed to by the iterator position. Returns an iterator pointing to the
element following the deleted element, or end() if the deleted item was the last one in this list.
iterator
erase (iterator first, iterator last);