std::flat_set<Key,Compare,KeyContainer>:: flat_set
|
flat_set
(
)
: flat_set ( key_compare ( ) ) { } |
(1) | (начиная с C++23) |
|
template
<
class
Allocator
>
flat_set ( const flat_set & other, const Allocator > alloc ) ; |
(2) | (начиная с C++23) |
|
template
<
class
Allocator
>
flat_set ( flat_set && other, const Allocator & alloc ) ; |
(3) | (начиная с C++23) |
|
explicit
flat_set
(
container_type cont,
const key_compare & comp = key_compare ( ) ) ; |
(4) | (начиная с C++23) |
|
template
<
class
Allocator
>
flat_set ( const container_type & cont, const Allocator & alloc ) ; |
(5) | (начиная с C++23) |
|
template
<
class
Allocator
>
flat_set
(
const
container_type
&
cont,
const
key_compare
&
comp,
|
(6) | (начиная с C++23) |
|
flat_set
(
std::
sorted_unique_t
s, container_type cont,
const
key_compare
&
comp
=
key_compare
(
)
)
|
(7) | (начиная с C++23) |
|
template
<
class
Allocator
>
flat_set
(
std::
sorted_unique_t
s,
const
container_type
&
cont,
|
(8) | (начиная с C++23) |
|
template
<
class
Allocator
>
flat_set
(
std::
sorted_unique_t
s,
const
container_type
&
cont,
|
(9) | (начиная с C++23) |
|
explicit
flat_set
(
const
key_compare
&
comp
)
: c ( ) , compare ( comp ) { } |
(10) | (начиная с C++23) |
|
template
<
class
Allocator
>
flat_set ( const key_compare & comp, const Allocator & alloc ) ; |
(11) | (начиная с C++23) |
|
template
<
class
Allocator
>
explicit flat_set ( const Allocator & alloc ) ; |
(12) | (начиная с C++23) |
|
template
<
class
InputIter
>
flat_set
(
InputIter first, InputIter last,
|
(13) | (начиная с C++23) |
|
template
<
class
InputIter,
class
Allocator
>
flat_set
(
InputIter first, InputIter last,
|
(14) | (начиная с C++23) |
|
template
<
class
InputIter,
class
Allocator
>
flat_set ( InputIter first, InputIter last, const Allocator & alloc ) ; |
(15) | (начиная с C++23) |
|
template
<
container-compatible-range
<
value_type
>
R
>
flat_set
(
std::
from_range_t
, R
&&
rg,
const
key_compare
&
comp
)
|
(16) | (начиная с C++23) |
|
template
<
container-compatible-range
<
value_type
>
R
>
flat_set
(
std::
from_range_t
fr, R
&&
rg
)
|
(17) | (начиная с C++23) |
|
template
<
container-compatible-range
<
value_type
>
R,
class
Allocator
>
flat_set ( std:: from_range_t , R && rg, const Allocator & alloc ) ; |
(18) | (начиная с C++23) |
|
template
<
container-compatible-range
<
value_type
>
R,
class
Allocator
>
flat_set
(
std::
from_range_t
, R
&&
rg,
const
key_compare
&
comp,
|
(19) | (начиная с C++23) |
|
template
<
class
InputIter
>
flat_set
(
std::
sorted_unique_t
s, InputIter first, InputIter last,
|
(20) | (начиная с C++23) |
|
template
<
class
InputIter,
class
Allocator
>
flat_set
(
std::
sorted_unique_t
s, InputIter first, InputIter last,
|
(21) | (начиная с C++23) |
|
template
<
class
InputIter,
class
Allocator
>
flat_set
(
std::
sorted_unique_t
s, InputIter first, InputIter last,
|
(22) | (начиная с C++23) |
|
flat_set
(
std::
initializer_list
<
value_type
>
init,
const
key_compare
&
comp
=
key_compare
(
)
)
|
(23) | (начиная с C++23) |
|
template
<
class
Allocator
>
flat_set
(
std::
initializer_list
<
value_type
>
init,
const
key_compare
&
comp,
|
(24) | (начиная с C++23) |
|
template
<
class
Allocator
>
flat_set ( std:: initializer_list < value_type > init, const Allocator & alloc ) ; |
(25) | (начиная с C++23) |
|
flat_set
(
std::
sorted_unique_t
s,
std::
initializer_list
<
value_type
>
init,
const
key_compare
&
comp
=
key_compare
(
)
)
|
(26) | (начиная с C++23) |
|
template
<
class
Allocator
>
flat_set
(
std::
sorted_unique_t
s,
std::
initializer_list
<
value_type
>
init,
|
(27) | (начиная с C++23) |
|
template
<
class
Allocator
>
flat_set
(
std::
sorted_unique_t
s,
std::
initializer_list
<
value_type
>
init,
|
(28) | (начиная с C++23) |
Создает новый адаптер контейнера из различных источников данных и опционально предоставленного функционального объекта сравнения comp и/или аллокатора alloc .
c
with the copy of the contents of
other.
c
and
compare
with
other.
compare
.
See
allocator usage note
below.
c
с помощью
std
::
move
(
cont
)
и
compare
с помощью
comp
. Затем сортирует
c
относительно
comp
. Наконец, делает элементы уникальными, т.е. удаляет все, кроме первого элемента из каждой группы последовательных эквивалентных элементов.
c
с помощью
std
::
move
(
cont
)
и
compare
с помощью
comp
.
[
first
,
last
)
, эквивалентно
insert
(
first, last
)
;
.
c
содержимым
rg
как если бы с помощью
insert_range
(
std::
forward
<
R
>
(
rg
)
)
;
.
[
first
,
last
)
. Инициализирует
c
значением
c
(
first, last
)
и
compare
значением
compare
(
comp
)
.
Примечание для перегрузок
(13-15,20-22)
: Если
[
first
,
last
)
не является
допустимым диапазоном
, поведение не определено.
Note for overloads (4-6,13-19,23-25) : If multiple elements in the range have keys that compare equivalent, it is unspecified which element is inserted (pending LWG2844 ).
Содержание |
Примечание по использованию аллокатора
Конструкторы
(2,3,5,6,8,9,11,12,14,15,17,19,21,22,24,25,27,28)
эквивалентны соответствующим конструкторам без аллокатора, за исключением того, что
c
конструируется с помощью
uses-allocator construction
.
Эти перегрузки участвуют в разрешении перегрузки только если
std::
uses_allocator_v
<
container_type, Allocator
>
равно
true
.
Параметры
| cont | - | контейнер, используемый в качестве источника для инициализации базового контейнера |
| other | - |
другой
flat_set
, используемый в качестве источника для инициализации элементов базового контейнера
|
| alloc | - | аллокатор, используемый для всех выделений памяти базового контейнера |
| comp | - | функциональный объект, используемый для всех сравнений ключей |
| first, last | - | пара итераторов, определяющая исходный диапазон элементов для копирования |
| init | - | список инициализации для инициализации элементов базового контейнера |
| rg | - |
совместимый с контейнером диапазон
(то есть
input_range
, элементы которого конвертируются в
value_type
), используемый в качестве источника для инициализации базового контейнера
|
| fr | - | тег устранения неоднозначности , указывающий, что содержащийся член должен быть сконструирован из диапазона |
| s | - |
тег устранения неоднозначности
, указывающий, что входная последовательность отсортирована относительно
compare
и все её элементы уникальны
|
| Требования к типам | ||
-
InputIt
должен удовлетворять требованиям
LegacyInputIterator
.
|
||
-
Compare
должен удовлетворять требованиям
Compare
.
|
||
-
Allocator
должен удовлетворять требованиям
Allocator
.
|
||
Сложность
[
first
,
last
)
отсортирован относительно
compare
, иначе
𝓞(N·log(N))
, где
N
равно значению
cont.
size
(
)
до этого вызова.
[
first
,
last
)
.
Исключения
Вызовы
Allocator::allocate
могут генерировать исключения.
Примечания
После перемещающего конструирования контейнера (перегрузка ( 3 ) ), ссылки, указатели и итераторы (кроме конечного итератора) на other остаются действительными, но ссылаются на элементы, которые теперь находятся в * this . Текущий стандарт обеспечивает эту гарантию с помощью общего положения в [container.reqmts]/67 , и более прямая гарантия рассматривается через LWG issue 2321 .
Пример
|
Этот раздел не завершён
Причина: отсутствует пример |
Смотрите также
|
присваивает значения адаптеру контейнера
(публичная функция-член) |