Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aaff7b5
commit 9430b41
Showing
4 changed files
with
116 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# empty | ||
* flat_map[meta header] | ||
* std[meta namespace] | ||
* flat_map[meta class] | ||
* function[meta id-type] | ||
* cpp23[meta cpp] | ||
|
||
```cpp | ||
[[nodiscard]] bool empty() const noexcept; // (1) C++23 | ||
``` | ||
|
||
## 概要 | ||
コンテナが空かどうかをテストする。 | ||
コンテナが空([`size()`](size.md) が 0)の場合に `true` を返す。 | ||
|
||
この関数はコンテナ内のコンテンツを変化させない。コンテンツをクリアするには [`clear()`](clear.md.nolink) メンバ関数を使用する。 | ||
|
||
|
||
## 戻り値 | ||
コンテナサイズが 0 のときに `true`, そうでないときに `false` を返す。 | ||
|
||
|
||
## 計算量 | ||
定数時間。 | ||
|
||
|
||
## 例 | ||
```cpp example | ||
#include <iostream> | ||
#include <flat_map> | ||
|
||
int main () | ||
{ | ||
stdx::flat_map<int, char> fm; | ||
|
||
std::cout << fm.empty() << std::endl; | ||
|
||
fm.insert({42, 'a'}); | ||
|
||
std::cout << fm.empty() << std::endl; | ||
} | ||
``` | ||
* empty()[color ff0000] | ||
* fm.insert[link insert.md.nolink] | ||
|
||
### 出力 | ||
``` | ||
1 | ||
0 | ||
``` | ||
|
||
## バージョン | ||
### 言語 | ||
- C++23 | ||
|
||
### 処理系 | ||
- [Clang](/implementation.md#clang): ?? | ||
- [GCC](/implementation.md#gcc): ?? | ||
- [Visual C++](/implementation.md#visual_cpp): ?? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# max_size | ||
* flat_map[meta header] | ||
* std[meta namespace] | ||
* flat_map[meta class] | ||
* function[meta id-type] | ||
* cpp23[meta cpp] | ||
|
||
```cpp | ||
size_type max_size() const noexcept; // (1) C++23 | ||
``` | ||
|
||
## 概要 | ||
コンテナが格納できる要素の最大数を返す。 | ||
これは、システムやライブラリ実装の制限のもとでコンテナが格納できる潜在的な最大サイズである。 | ||
|
||
|
||
## 戻り値 | ||
コンテナが自身のコンテンツとして保持できる要素の最大数。 | ||
メンバ型 `size_type` は符号なし整数型である。 | ||
|
||
|
||
## 計算量 | ||
定数時間。 | ||
|
||
|
||
## 例 | ||
```cpp example | ||
#include <iostream> | ||
#include <flat_map> | ||
|
||
int main() | ||
{ | ||
std::flat_map<char, int> fm; | ||
|
||
std::cout << fm.max_size() << std::endl; | ||
} | ||
``` | ||
* max_size()[color ff0000] | ||
|
||
### 出力例 | ||
``` | ||
178956970 | ||
``` | ||
|
||
## 言語バージョン | ||
- C++23 | ||
|
||
### 処理系 | ||
- [Clang](/implementation.md#clang): ?? | ||
- [GCC](/implementation.md#gcc): ?? | ||
- [Visual C++](/implementation.md#visual_cpp): ?? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,4 @@ int main () | |
|
||
|
||
## 関連項目 | ||
- [`empty()`](empty.md.nolink) | ||
- [`empty()`](empty.md) |