std::unordered_set<Key,Hash,KeyEqual,Allocator>:: unordered_set
| (1) | ||
|
unordered_set
(
)
: unordered_set ( size_type ( /* unspecified */ ) ) { } |
(C++11以降)
(C++20まで) |
|
|
unordered_set
(
)
;
|
(C++20以降) | |
|
explicit
unordered_set
(
size_type bucket_count,
const
Hash
&
hash
=
Hash
(
)
,
|
(2) | (C++11以降) |
|
unordered_set
(
size_type bucket_count,
const
Allocator
&
alloc
)
|
(3) | (C++14以降) |
|
unordered_set
(
size_type bucket_count,
const
Hash
&
hash,
|
(4) | (C++14以降) |
|
explicit
unordered_set
(
const
Allocator
&
alloc
)
;
|
(5) | (C++11以降) |
|
template
<
class
InputIt
>
unordered_set
(
InputIt first, InputIt last,
|
(6) | (C++11以降) |
|
template
<
class
InputIt
>
unordered_set
(
InputIt first, InputIt last,
|
(7) | (C++14以降) |
|
template
<
class
InputIt
>
unordered_set
(
InputIt first, InputIt last,
|
(8) | (C++14以降) |
|
unordered_set
(
const
unordered_set
&
other
)
;
|
(9) | (C++11以降) |
|
unordered_set
(
const
unordered_set
&
other,
const
Allocator
&
alloc
)
;
|
(10) | (C++11以降) |
|
unordered_set
(
unordered_set
&&
other
)
;
|
(11) | (C++11以降) |
|
unordered_set
(
unordered_set
&&
other,
const
Allocator
&
alloc
)
;
|
(12) | (C++11以降) |
|
unordered_set
(
std::
initializer_list
<
value_type
>
init,
size_type bucket_count
=
/* 未指定 */
,
|
(13) | (C++11以降) |
|
unordered_set
(
std::
initializer_list
<
value_type
>
init,
size_type bucket_count,
|
(14) | (C++14以降) |
|
unordered_set
(
std::
initializer_list
<
value_type
>
init,
size_type bucket_count,
|
(15) | (C++14以降) |
|
template
<
container-compatible-range
<
value_type
>
R
>
unordered_set
(
std::
from_range_t
, R
&&
rg,
|
(16) | (C++23以降) |
|
template
<
container-compatible-range
<
value_type
>
R
>
unordered_set
(
std::
from_range_t
, R
&&
rg,
|
(17) | (C++23以降) |
|
template
<
container-compatible-range
<
value_type
>
R
>
unordered_set
(
std::
from_range_t
, R
&&
rg,
|
(18) | (C++23以降) |
様々なデータソースから新しいコンテナを構築します。オプションでユーザー指定の bucket_count を最小バケット数として使用し、 hash をハッシュ関数、 equal をキー比較関数、 alloc をアロケータとして使用します。
[
first
,
last
)
の内容でコンテナを構築します。
max_load_factor()
を
1.0
に設定します。範囲内の複数の要素が同等のキーを持つ場合、どの要素が挿入されるかは未規定です(
LWG2844
保留中)。
|
テンプレートパラメータ
|
(C++23以降) |
|
テンプレートパラメータ |
(C++23以降) |
目次パラメータ
計算量
1-5)
定数。
9,10)
サイズに対して線形
other
.
11,12)
定数。もし
alloc
が与えられ、かつ
alloc
!
=
other.
get_allocator
(
)
の場合、線形。
例外
注釈コンテナのムーブ構築 (オーバーロード (4)) の後、元々 C++23 まで正式に要求されていませんが、一部の実装は以前のモードで既にテンプレートパラメータ
例
不具合報告以下の動作変更に関する欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。
関連項目
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||