Standard C++ Library Class Reference

Constructors and Destructors
explicit
set (const Compare& comp = Compare(),
const Allocator& alloc = Allocator ());
The default constructor. Creates a set of zero elements. If the function object comp is supplied, it
is used to compare elements of the set. Otherwise, the default function object in the template
argument is used. The template argument defaults to less (<). The allocator alloc is used for all
storage management.
template <class InputIterator>
set (InputIterator first, InputIterator last,
const Compare& comp = Compare ()
const Allocator& alloc = Allocator());
Creates a set of length last - first, filled with all values obtained by dereferencing the
InputIterators on the range [first, last). If the function object comp is supplied, it is used to
compare elements of the set. Otherwise, the default function object in the template argument is
used. The template argument defaults to less (<). Uses the allocator alloc for all storage
management.
set (const set<Key, Compare, Allocator>& x);
Copy constructor. Creates a copy of x.
~set ();
The destructor. Releases any allocated memory for self.
Assignment Operator
set<Key, Compare, Allocator>&
operator= (const set<Key, Compare, Allocator>& x);
Assignment operator. Self will share an implementation with x. Returns a reference to self.
Allocator
allocator_type get_allocator () const;
Returns a copy of the allocator used by self for storage management.
Iterators
iterator begin ();
Returns an iterator that points to the first element in self.
const_iterator begin () const;
Returns a const_iterator that points to the first element in self.
iterator end ();