std::flat_multiset<Key,Compare,KeyContainer>:: flat_multiset
|
flat_multiset
(
)
: flat_multiset ( key_compare ( ) ) { } |
(1) | (C++23 起) |
|
template
<
class
Allocator
>
flat_multiset ( const flat_multiset & other, const Allocator > alloc ) ; |
(2) | (自 C++23 起) |
|
template
<
class
Allocator
>
flat_multiset ( flat_multiset && other, const Allocator & alloc ) ; |
(3) | (自 C++23 起) |
|
explicit
flat_multiset
(
container_type cont,
const key_compare & comp = key_compare ( ) ) ; |
(4) | (自 C++23 起) |
|
template
<
class
Allocator
>
flat_multiset ( const container_type & cont, const Allocator & alloc ) ; |
(5) | (自 C++23 起) |
|
template
<
class
Allocator
>
flat_multiset
(
const
container_type
&
cont,
const
key_compare
&
comp,
|
(6) | (自 C++23 起) |
|
flat_multiset
(
std::
sorted_equivalent_t
s, container_type cont,
const
key_compare
&
comp
=
key_compare
(
)
)
|
(7) | (自 C++23 起) |
|
template
<
class
Allocator
>
flat_multiset
(
std::
sorted_equivalent_t
s,
const
container_type
&
cont,
|
(8) | (C++23 起) |
|
template
<
class
Allocator
>
flat_multiset
(
std::
sorted_equivalent_t
s,
const
container_type
&
cont,
|
(9) | (自 C++23 起) |
|
explicit
flat_multiset
(
const
key_compare
&
comp
)
: c ( ) , compare ( comp ) { } |
(10) | (自 C++23 起) |
|
template
<
class
Allocator
>
flat_multiset ( const key_compare & comp, const Allocator & alloc ) ; |
(11) | (自 C++23 起) |
|
template
<
class
Allocator
>
explicit flat_multiset ( const Allocator & alloc ) ; |
(12) | (自 C++23 起) |
|
template
<
class
InputIter
>
flat_multiset
(
InputIter first, InputIter last,
|
(13) | (自 C++23 起) |
|
template
<
class
InputIter,
class
Allocator
>
flat_multiset
(
InputIter first, InputIter last,
|
(14) | (自 C++23 起) |
|
template
<
class
InputIter,
class
Allocator
>
flat_multiset ( InputIter first, InputIter last, const Allocator & alloc ) ; |
(15) | (自 C++23 起) |
|
template
<
container-compatible-range
<
value_type
>
R
>
flat_multiset
(
std::
from_range_t
, R
&&
rg,
const
key_compare
&
comp
)
|
(16) | (C++23 起) |
|
template
<
container-compatible-range
<
value_type
>
R
>
flat_multiset
(
std::
from_range_t
fr, R
&&
rg
)
|
(17) | (自 C++23 起) |
|
template
<
container-compatible-range
<
value_type
>
R,
class
Allocator
>
flat_multiset ( std:: from_range_t , R && rg, const Allocator & alloc ) ; |
(18) | (自 C++23 起) |
|
template
<
container-compatible-range
<
value_type
>
R,
class
Allocator
>
flat_multiset
(
std::
from_range_t
, R
&&
rg,
const
key_compare
&
comp,
|
(19) | (自 C++23 起) |
|
template
<
class
InputIter
>
flat_multiset
(
std::
sorted_equivalent_t
s, InputIter first, InputIter last,
|
(20) | (自 C++23 起) |
|
template
<
class
InputIter,
class
Allocator
>
flat_multiset
(
std::
sorted_equivalent_t
s, InputIter first, InputIter last,
|
(21) | (自 C++23 起) |
|
template
<
class
InputIter,
class
Allocator
>
flat_multiset
(
std::
sorted_equivalent_t
s, InputIter first, InputIter last,
|
(22) | (自 C++23 起) |
|
flat_multiset
(
std::
initializer_list
<
value_type
>
init,
const
key_compare
&
comp
=
key_compare
(
)
)
|
(23) | (自 C++23 起) |
|
template
<
class
Allocator
>
flat_multiset
(
std::
initializer_list
<
value_type
>
init,
const
key_compare
&
comp,
|
(24) | (自 C++23 起) |
|
template
<
class
Allocator
>
flat_multiset ( std:: initializer_list < value_type > init, const Allocator & alloc ) ; |
(25) | (自 C++23 起) |
|
flat_multiset
(
std::
sorted_equivalent_t
s,
std::
initializer_list
<
value_type
>
init,
const
key_compare
&
comp
=
key_compare
(
)
)
|
(26) | (自 C++23 起) |
|
template
<
class
Allocator
>
flat_multiset
(
std::
sorted_equivalent_t
s,
std::
initializer_list
<
value_type
>
init,
|
(27) | (自 C++23 起) |
|
template
<
class
Allocator
>
flat_multiset
(
std::
sorted_equivalent_t
s,
std::
initializer_list
<
value_type
>
init,
|
(28) | (C++23 起) |
从多种数据源构造新的容器适配器,并可选择性地提供比较函数对象 comp 和/或分配器 alloc 。
c
时复制
other.
c
的内容,并构造
compare
时使用
other.
compare
。
请参阅下方的
allocator usage note
。
[
first
,
last
)
中的元素,等价于
insert
(
first, last
)
;
。
c
的内容,通过
insert_range
(
std::
forward
<
R
>
(
rg
)
)
;
的方式传入
rg
的内容。
关于重载
(13-15,20-22)
的说明:如果
[
first
,
last
)
不是
有效范围
,则行为未定义。
目录 |
分配器使用说明
构造函数
(2,3,5,6,8,9,11,12,14,15,17,19,21,22,24,25,27,28)
与对应的非分配器构造函数等效,区别在于
c
是通过
使用分配器构造
方式构建的。
这些重载仅当
std::
uses_allocator_v
<
container_type, Allocator
>
为
true
时参与重载决议。
参数
| cont | - | 用作初始化底层容器的源容器 |
| other | - |
用作初始化底层容器元素的另一个
flat_multiset
源
|
| alloc | - | 用于底层容器所有内存分配的分配器 |
| comp | - | 用于所有键比较的函数对象 |
| first, last | - | 定义待复制元素源 范围 的迭代器对 |
| init | - | 用于初始化底层容器元素的初始化列表 |
| rg | - |
用作初始化底层容器源的
容器兼容范围
(即元素可转换为
value_type
的
input_range
)
|
| fr | - | 指示应进行范围构造的 消歧标签 |
| s | - |
指示输入序列已按
compare
排序的
消歧标签
|
| 类型要求 | ||
-
InputIt
必须满足
LegacyInputIterator
要求
|
||
-
Compare
必须满足
Compare
要求
|
||
-
Allocator
必须满足
Allocator
要求
|
||
复杂度
[
first
,
last
)
已按
compare
排序,则时间复杂度为
N
的线性阶;否则为
𝓞(N·log(N))
,其中
N
表示本次调用前
cont.
size
(
)
的值。
[
first
,
last
)
的大小成线性关系。
异常处理
对
Allocator::allocate
的调用可能抛出异常。
注释
在容器移动构造(重载 ( 3 ) 之后,指向 other 的引用、指针和迭代器(除尾后迭代器外)保持有效,但所引用的元素现在位于 * this 中。当前标准通过 [container.reqmts]/67 中的总体说明提供此保证,同时正在通过 LWG 问题 2321 考虑更直接的保证方式。
示例
|
本节内容不完整
原因:缺少示例 |
另请参阅
|
为容器适配器赋值
(公开成员函数) |