"HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org"> insert cppreference.com > "index.html">C++ Sets > insert insert Syntax: #include <set> iterator insert( iterator i, const "../containers.html">TYPE& val ); void insert( "../iterators.html">input_iterator start, "../iterators.html">input_iterator end ); pair<iterator,bool> insert( const "../containers.html">TYPE& val ); The function insert() either: inserts val after the element at pos (where pos is really just a suggestion as to where val should go, since sets and maps are ordered), and returns an iterator to that element. inserts a range of elements from start to end. inserts val, but only if val doesn't already exist. The return value is an iterator to the element inserted, and a boolean describing whether an insertion took place. Related topics: (C++ Maps) Map operators