File tree Expand file tree Collapse file tree 4 files changed +116
-4
lines changed Expand file tree Collapse file tree 4 files changed +116
-4
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,10 @@ namespace std {
47
47
### 領域
48
48
49
49
| 名前 | 説明 | 対応バージョン |
50
- |---------------------------------|------------------------------------|-------|
51
- | [`empty`](flat_map/empty.md.nolink ) | コンテナが空であるかどうかを調べる | C++23 |
50
+ |------------------------------------ |------------------------------------|-------|
51
+ | [`empty`](flat_map/empty.md) | コンテナが空であるかどうかを調べる | C++23 |
52
52
| [`size`](flat_map/size.md) | 要素数を取得する | C++23 |
53
- | [`max_size`](flat_map/max_size.md.nolink ) | 格納可能な最大の要素数を取得する | C++23 |
53
+ | [`max_size`](flat_map/max_size.md) | 格納可能な最大の要素数を取得する | C++23 |
54
54
55
55
56
56
### コンテナの変更
Original file line number Diff line number Diff line change
1
+ # empty
2
+ * flat_map[ meta header]
3
+ * std[ meta namespace]
4
+ * flat_map[ meta class]
5
+ * function[ meta id-type]
6
+ * cpp23[ meta cpp]
7
+
8
+ ``` cpp
9
+ [[nodiscard]] bool empty () const noexcept ; // (1) C++23
10
+ ```
11
+
12
+ ## 概要
13
+ コンテナが空かどうかをテストする。
14
+ コンテナが空([ ` size() ` ] ( size.md ) が 0)の場合に ` true ` を返す。
15
+
16
+ この関数はコンテナ内のコンテンツを変化させない。コンテンツをクリアするには [ ` clear() ` ] ( clear.md.nolink ) メンバ関数を使用する。
17
+
18
+
19
+ ## 戻り値
20
+ コンテナサイズが 0 のときに ` true ` , そうでないときに ` false ` を返す。
21
+
22
+
23
+ ## 計算量
24
+ 定数時間。
25
+
26
+
27
+ ## 例
28
+ ``` cpp example
29
+ #include < iostream>
30
+ #include < flat_map>
31
+
32
+ int main ()
33
+ {
34
+ stdx::flat_map<int, char> fm;
35
+
36
+ std::cout << fm.empty() << std::endl;
37
+
38
+ fm.insert({42, 'a'});
39
+
40
+ std::cout << fm.empty() << std::endl;
41
+ }
42
+ ```
43
+ * empty()[ color ff0000]
44
+ * fm.insert[ link insert.md.nolink]
45
+
46
+ ### 出力
47
+ ```
48
+ 1
49
+ 0
50
+ ```
51
+
52
+ ## バージョン
53
+ ### 言語
54
+ - C++23
55
+
56
+ ### 処理系
57
+ - [ Clang] ( /implementation.md#clang ) : ??
58
+ - [ GCC] ( /implementation.md#gcc ) : ??
59
+ - [ Visual C++] ( /implementation.md#visual_cpp ) : ??
60
+
Original file line number Diff line number Diff line change
1
+ # max_size
2
+ * flat_map[ meta header]
3
+ * std[ meta namespace]
4
+ * flat_map[ meta class]
5
+ * function[ meta id-type]
6
+ * cpp23[ meta cpp]
7
+
8
+ ``` cpp
9
+ size_type max_size () const noexcept ; // (1) C++23
10
+ ```
11
+
12
+ ## 概要
13
+ コンテナが格納できる要素の最大数を返す。
14
+ これは、システムやライブラリ実装の制限のもとでコンテナが格納できる潜在的な最大サイズである。
15
+
16
+
17
+ ## 戻り値
18
+ コンテナが自身のコンテンツとして保持できる要素の最大数。
19
+ メンバ型 ` size_type ` は符号なし整数型である。
20
+
21
+
22
+ ## 計算量
23
+ 定数時間。
24
+
25
+
26
+ ## 例
27
+ ``` cpp example
28
+ #include < iostream>
29
+ #include < flat_map>
30
+
31
+ int main ()
32
+ {
33
+ std::flat_map<char, int> fm;
34
+
35
+ std::cout << fm.max_size() << std::endl;
36
+ }
37
+ ```
38
+ * max_size()[ color ff0000]
39
+
40
+ ### 出力例
41
+ ```
42
+ 178956970
43
+ ```
44
+
45
+ ## 言語バージョン
46
+ - C++23
47
+
48
+ ### 処理系
49
+ - [ Clang] ( /implementation.md#clang ) : ??
50
+ - [ GCC] ( /implementation.md#gcc ) : ??
51
+ - [ Visual C++] ( /implementation.md#visual_cpp ) : ??
52
+
Original file line number Diff line number Diff line change @@ -62,4 +62,4 @@ int main ()
62
62
63
63
64
64
## 関連項目
65
- - [ ` empty() ` ] ( empty.md.nolink )
65
+ - [ ` empty() ` ] ( empty.md )
You can’t perform that action at this time.
0 commit comments