std::set::set
cppreference.com
[] |
Google. . , . , . |
<metanoindex/>
<tbody> </tbody> <tbody class="t-dcl-rev t-dcl-rev-num "> </tbody><tbody> </tbody> <tbody class="t-dcl-rev t-dcl-rev-num "> </tbody><tbody> </tbody> <tbody class="t-dcl-rev t-dcl-rev-num "> </tbody><tbody> </tbody>| (1) | ||
explicit set( const Compare& comp = Compare(), {{#pad:|12}} const Allocator& alloc = Allocator() ); |
( C++14) | |
set() : set( Compare() ) {} explicit set( const Compare& comp, {{#pad:|12}} const Allocator& alloc = Allocator() ); |
( C++14) | |
explicit set( const Allocator& alloc ); |
(1) | ( C++11) |
| (2) | ||
template< class InputIterator > set( InputIterator first, InputIterator last, {{#pad:|3}} const Compare& comp = Compare(), {{#pad:|3}} const Allocator& alloc = Allocator() ); |
||
template< class InputIterator > set( InputIterator first, InputIterator last, {{#pad:|3}} const Allocator& alloc ); |
( C++14) | |
set( const set& other ); |
(3) | |
set( const set& other, const Allocator& alloc ); |
(3) | ( C++11) |
set( set&& other ); |
(4) | ( C++11) |
set( set&& other, const Allocator& alloc ); |
(4) | ( C++11) |
| (5) | ||
set( std::initializer_list<value_type> init, {{#pad:|3}} const Compare& comp = Compare(), {{#pad:|3}} const Allocator& alloc = Allocator() ); |
( C++11) | |
set( std::initializer_list<value_type> init, {{#pad:|3}} const Allocator& ); |
( C++14) | |
() alloc comp.
1)
. .
2)
[first, last).3)
.
other. alloc , std::allocator_traits<allocator_type>::select_on_container_copy_construction(other.get_allocator()).:
copy constructor. Constructs the container with the copy of the contents of
other. If alloc is not provided, allocator is obtained by calling std::allocator_traits<allocator_type>::select_on_copy_construction(other).4)
Move-.
other move-. alloc , move- other.:
move constructor. Constructs the container with the contents of
other using move semantics. If alloc is not provided, allocator is obtained by move-construction from the allocator belonging to other.5)
init. | alloc | ||
| comp | ||
| first, last | ||
| other | ,
: another container to be used as source to initialize the elements of the container with | |
| init | ||
-InputIt InputIterator.
| ||
1)
2) N log(N),
N = std::distance(first, last) , N value_comp().3)
other4)
.
alloc alloc != other.get_allocator(), .5) N log(N),
N = init.size()) , N init value_comp(). ( (4)), , ( ) other , *this. [container.reqmts]/67, LWG 2321.
| : |
.
| (public -) |