std::set::insert

std::pair<iterator,bool> insert( const value_type& value ); (1) std::pair<iterator,bool> insert( value_type&& value ); (2) (since C++11) (3) iterator insert( iterator hint, const value_type& value ); (until C++11) iterator insert( const_iterator hint, const value_type& value ); (since C++11) iterator insert( const_iterator hint, value_type&& value ); (4) (since C++11) template< class InputIt > void insert( InputIt firs

std::set::get_allocator

allocator_type get_allocator() const; Returns the allocator associated with the container. Parameters (none). Return value The associated allocator. Complexity Constant.

std::set::find

iterator find( const Key& key ); (1) const_iterator find( const Key& key ) const; (2) template< class K > iterator find( const K& x ); (3) (since C++14) template< class K > const_iterator find( const K& x ) const; (4) (since C++14) 1,2) Finds an element with key equivalent to key. 3,4) Finds an element with key that compares equivalent to the value x. This overload only participates in overload resolution if the qualified-id Compare::is_t

std::set::erase

(1) void erase( iterator pos ); (until C++11) iterator erase( iterator pos ); (since C++17) iterator erase( const_iterator pos ); (since C++11) (2) void erase( iterator first, iterator last ); (until C++11) iterator erase( const_iterator first, const_iterator last ); (since C++11) size_type erase( const key_type& key ); (3) Removes specified elements from the container. 1) Removes the element at pos. 2) Removes the elements in the range [first; last),

std::set::equal_range

std::pair<iterator,iterator> equal_range( const Key& key ); (1) std::pair<const_iterator,const_iterator> equal_range( const Key& key ) const; (2) template< class K > std::pair<iterator,iterator> equal_range( const K& x ); (3) (since C++14) template< class K > std::pair<const_iterator,const_iterator> equal_range( const K& x ) const; (4) (since C++14) Returns a range containing all elements with the given key in the con

std::set::end

iterator end(); const_iterator end() const; const_iterator cend() const; (since C++11) Returns an iterator to the element following the last element of the container. This element acts as a placeholder; attempting to access it results in undefined behavior. Parameters (none). Return value Iterator to the element following the last element. Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11) Complexity Constant. See also begin

std::set::empty

bool empty() const; Checks if the container has no elements, i.e. whether begin() == end(). Parameters (none). Return value true if the container is empty, false otherwise. Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11) Complexity Constant. Example The following code uses empty to check if a std::set<int> contains any elements: #include <set> #include <iostream> int main() { std::set<int> numbers; std:

std::set::emplace_hint

template <class... Args> iterator emplace_hint( const_iterator hint, Args&&... args ); (since C++11) Inserts a new element into the container as close as possible to the position just before hint. The element is constructed in-place, i.e. no copy or move operations are performed. The constructor of the element is called with exactly the same arguments as supplied to the function, forwarded with std::forward<Args>(args).... No iterators or references are invalidated.

std::set::emplace

template< class... Args > std::pair<iterator,bool> emplace( Args&&... args ); (since C++11) Inserts a new element into the container by constructing it in-place with the given args if there is no element with the key in the container. Careful use of emplace allows the new element to be constructed while avoiding unnecessary copy or move operations. The constructor of the new element is called with exactly the same arguments as supplied to emplace, forwarded via std::

std::set::count

size_type count( const Key& key ) const; (1) template< class K > size_type count( const K& x ) const; (2) (since C++14) 1) Returns the number of elements with key key, which is either 1 or 0 since this container does not allow duplicates 2) Returns the number of elements with key that compares equivalent to the value x. This overload only participates in overload resolution if the qualified-id Compare::is_transparent is valid and denotes a type. They allow calling