std::set::insert
cppreference.com
[] |
Google. . , . , . |
<metanoindex/>
<tbody> </tbody> std::pair<iterator,bool> insert( const value_type& value ); |
(1) | |
std::pair<iterator, bool> insert( value_type&& value ); |
(2) | ( C++11) |
iterator insert( iterator hint, const value_type& value ); iterator insert( const_iterator hint, const value_type& value ); |
(3) | ( C++11) ( C++11) |
iterator insert( const_iterator hint, value_type&& value ); |
(4) | ( C++11) |
template< class InputIt > void insert( InputIt first, InputIt last ); |
(5) | |
void insert( std::initializer_list<value_type> ilist ); |
(6) | ( C++11) |
Inserts element(s) to the container, if the container doesn't already contain an element with equivalent key.
1-2)
value. 3-4) inserts value in the position as close as possible, just prior( C++11), to hint.
5)
[first, last).6)
ilist..
| hint | , , | |
| value | ||
| first, last | , | |
| ilist | , | |
-InputIt InputIterator.
| ||
1-2) ( , ),
bool, , .3-4) , , .
5-6) .
1-2) ,
O(log(size())).|
3-4) , . .
|
( C++11) |
|
3-4) , . .
|
( C++11) |
5-6)
O(N*log(size() + N)), N ..
(C++11) |
(public -) |
(C++11) |
, (public -) |