Skip to content

Commit

Permalink
basic_format_context : out, advance_to, localeを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
faithandbrave committed Jan 23, 2023
1 parent bc11699 commit 410c572
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 16 deletions.
22 changes: 11 additions & 11 deletions reference/format/basic_format_context.md
Expand Up @@ -19,28 +19,28 @@ namespace std {
## 概要
実際に渡されたフォーマット引数を含む、フォーマット実行中の状態を保持するクラス。
* (1): テンプレートの定義
* (2): マルチバイト文字列版の特殊化 (出力イテレータの型は未規定)
* (3): ワイド文字列版の特殊化 (出力イテレータの型は未規定)
- (1): テンプレートの定義
- (2): マルチバイト文字列版の別名 (出力イテレータの型は未規定)
- (3): ワイド文字列版の別名 (出力イテレータの型は未規定)
## テンプレートパラメータ制約
- `Out`は`OutputIterator<const charT&>`であること
`Out`は`OutputIterator<const charT&>`であること。
## メンバ関数
| 名前 | 説明 | 対応バージョン |
|--------------------------------------|--------------------------------------------------|----------------|
| [`arg`](basic_format_context/arg.md) | フォーマット引数を得る | C++20 |
| `out` | 出力イテレータを得る | C++20 |
| `advance_to` | 出力イテレータを指定したイテレータに設定する | C++20 |
| `locale` | ロケールを得る | C++20 |
| 名前 | 説明 | 対応バージョン |
|--------------------------------------|----------------------------------------------|----------------|
| [`arg`](basic_format_context/arg.md) | フォーマット引数を取得する | C++20 |
| [`out`](basic_format_context/out.md) | 出力イテレータを取得する | C++20 |
| [`advance_to`](basic_format_context/advance_to.md) | 出力イテレータを指定したイテレータに設定する | C++20 |
| [`locale`](basic_format_context/locale.md) | ロケールを取得する | C++20 |
## メンバ型
| 名前 | 説明 | 対応バージョン |
|------------------|----------------------------------------------------|----------------|
| `iterator` | 出力イテレータ(`Out`と等しい) (type-alias) | C++20 |
| `iterator` | 出力イテレータ(`Out`と等しい) (type-alias) | C++20 |
| `char_type` | 文字の型(`charT`と等しい) (type-alias) | C++20 |
| `formatter_type` | 型`T`に対応するフォーマッターの型 (alias-template) | C++20 |
Expand Down
40 changes: 40 additions & 0 deletions reference/format/basic_format_context/advance_to.md
@@ -0,0 +1,40 @@
# advance_to
* format[meta header]
* function[meta id-type]
* std[meta namespace]
* basic_format_context[meta class]
* cpp20[meta cpp]

```cpp
void advance_to(iterator it);
```
* basic_format_arg[link /reference/format/basic_format_arg.md]
* basic_format_context[link /reference/format/basic_format_context.md]
## 概要
出力イテレータを指定したイテレータに設定する。
## 効果
以下と等価:
```cpp
out_ = std::move(it);
```
* std::move[link /reference/utility/move.md]

ここで`out_`は、メンバ変数として保持している出力イテレータである。


## バージョン
### 言語
- C++20

### 処理系
- [Clang](/implementation.md#clang): ??
- [GCC](/implementation.md#gcc): 13
- [Visual C++](/implementation.md#visual_cpp): ??

## 参照

- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html)
9 changes: 4 additions & 5 deletions reference/format/basic_format_context/arg.md
@@ -1,31 +1,30 @@
# arg

* format[meta header]
* function[meta id-type]
* std[meta namespace]
* basic_format_context[meta class]
* cpp20[meta cpp]

```cpp
basic_format_arg<basic_format_context> arg(size_t id) const
basic_format_arg<basic_format_context> arg(size_t id) const;
```
* basic_format_arg[link /reference/format/basic_format_arg.md]
* basic_format_context[link /reference/format/basic_format_context.md]
## 概要
`i`番目のフォーマット引数を得る。`i`が範囲外の場合、`basic_format_arg<basic_format_context>`のデフォルト値を返す。
`i`番目のフォーマット引数を取得する。`i`が範囲外の場合、`basic_format_arg<basic_format_context>`のデフォルト値を返す。
## バージョン
### 言語
- C++20
### 処理系
- [Clang](/implementation.md#clang): ??
- [GCC](/implementation.md#gcc): ??
- [GCC](/implementation.md#gcc): 13
- [ICC](/implementation.md#icc): ??
- [Visual C++](/implementation.md#visual_cpp): ??
## 参照
* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html)
- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html)
32 changes: 32 additions & 0 deletions reference/format/basic_format_context/locale.md
@@ -0,0 +1,32 @@
# locale
* format[meta header]
* function[meta id-type]
* std[meta namespace]
* basic_format_context[meta class]
* cpp20[meta cpp]

```cpp
std::locale locale();
```
* std::locale[link /reference/locale/locale.md]

## 概要
ロケールを取得する。


## 効果
文字列フォーマット関数に指定されたロケールオブジェクトがあればそれを返し、そうでなければ[`std::locale()`](/reference/locale/locale.md)を返す。


## バージョン
### 言語
- C++20

### 処理系
- [Clang](/implementation.md#clang): ??
- [GCC](/implementation.md#gcc): 13
- [Visual C++](/implementation.md#visual_cpp): ??

## 参照

- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html)
40 changes: 40 additions & 0 deletions reference/format/basic_format_context/out.md
@@ -0,0 +1,40 @@
# out
* format[meta header]
* function[meta id-type]
* std[meta namespace]
* basic_format_context[meta class]
* cpp20[meta cpp]

```cpp
iterator out();
```
* basic_format_arg[link /reference/format/basic_format_arg.md]
* basic_format_context[link /reference/format/basic_format_context.md]

## 概要
出力イテレータを取得する。


## 効果
以下と等価:

```cpp
return std::move(out_);
```
* std::move[link /reference/utility/move.md]

ここで`out_`は、メンバ変数として保持している出力イテレータである。


## バージョン
### 言語
- C++20

### 処理系
- [Clang](/implementation.md#clang): ??
- [GCC](/implementation.md#gcc): 13
- [Visual C++](/implementation.md#visual_cpp): ??

## 参照

- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html)

0 comments on commit 410c572

Please sign in to comment.