Standard C++ Library Class Reference

Description
set<Key, Compare, Allocator> is an associative container that supports unique keys and provides for
fast retrieval of the keys. A set contains at most one of any key value. The keys are sorted using
Compare.
Since a set maintains a total order on its elements, you cannot alter the key values directly. Instead, you
must insert new elements with an insert_iterator.
Any type used for the template parameter Key must provide the following (where T is the type, t is a
value of T and u is a const value of T):
Copy constructors T(t) and T(u)
Destructor t.~T()
Address of &t and &u yielding T* and
const T* respectively
Assignment t = a where a is a
(possibly const) value of T
The type used for the Compare template parameter must satisfy the requirements for binary functions.
Interface
template <class Key, class Compare = less<Key>,
class Allocator = allocator>
class set {
public:
// types
typedef Key key_type;
typedef Key value_type;
typedef Compare key_compare;
typedef Compare value_compare;
typedef Allocator allocator_type;
typename reference;
typename const_reference;
typename iterator;
typename const_iterator;
typename size_type;
typename difference_type;
typename reverse_iterator;
typename const_reverse_iterator;
// Construct/Copy/Destroy
explicit set (const Compare& = Compare(),
const Allocator& = Allocator ());
template <class InputIterator>
set (InputIterator, InputIterator, const Compare& = Compare(),
const Allocator& = Allocator ());
set (const set<Key, Compare, Allocator>&);
~set ();
set<Key, Compare, Allocator>& operator= (const set <Key, Compare,