Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
11e6478
make_heap, push_heap : C++23 LWG Issue対応として制約を追加
faithandbrave Aug 17, 2026
9aa8bd0
atomic_flag : シグナル安全であることが明確化
faithandbrave Aug 17, 2026
519617a
chronoのformat : 精度指定が浮動小数点数のdurationに対してのみ指定できることが明確化
faithandbrave Aug 17, 2026
6ba61a0
nexttoward : 第2引数は固定でlong double
faithandbrave Aug 17, 2026
6d3c861
deque::prepend_range : 制約を追加
faithandbrave Aug 17, 2026
ecc1bc2
expected::transform_error : 「有効なエラー値型」をunexpectedに変更
faithandbrave Aug 17, 2026
821431a
formatter : noexceptを追加
faithandbrave Aug 17, 2026
a5ae26e
basic_format_parse_context : next_arg_idの引数番号が引数の個数以上となったら定数式評価されないこと…
faithandbrave Aug 17, 2026
1237e35
format : 幅・精度を動的引数として指定する場合には、引数が整数型に制限された
faithandbrave Aug 17, 2026
9c42abd
basic_const_iterator : LWG Issueを記載
faithandbrave Aug 17, 2026
890a297
ranges::distance : オーバーロードを分離
faithandbrave Aug 17, 2026
2789468
localeのコンストラクタ : ほぼ空だったので仕様を書き直した
faithandbrave Aug 17, 2026
d17d0e3
uses_allocator_construction_args : 制約を変更
faithandbrave Aug 17, 2026
0ea7230
adjacent(_transform)_view, slide_viewのbase : LWG Issueを追加
faithandbrave Aug 17, 2026
01b4d2b
as_const_view : LWG Issueを追加
faithandbrave Aug 18, 2026
aa5e4d8
ranges : range_common_reference_tを追加。C++20モードでも動いた
faithandbrave Aug 18, 2026
3211d27
ranges::to : LWG Issueを追加
faithandbrave Aug 18, 2026
9122e5e
match_resultsのコンストラクタ : アロケータを指定するコンストラクタを追加
faithandbrave Aug 18, 2026
2418d77
sub_match : swapを追加。C++20モードでも動作することを確認してある
faithandbrave Aug 18, 2026
5fa4632
char_traits::copy : LWG Issueを追加
faithandbrave Aug 18, 2026
7c5cbce
basic_osyncstreamの代入演算子 : 例外を送出する可能性があったのでnoexcept削除
faithandbrave Aug 18, 2026
611a117
reference_meows_from_temporary : conjunctionを使わない形で仕様が書き直された
faithandbrave Aug 18, 2026
570a475
cintypes : C++23のconstexpr対応 (あとで個別ページを作る)
faithandbrave Aug 18, 2026
eeb6694
version : フリースタンディングについて、機能テストマクロが全て定義されない可能性があることを記載
faithandbrave Aug 18, 2026
2113c83
version : C++29機能テストマクロを記載
faithandbrave Aug 18, 2026
34bcddf
cinttypesのリファレンスを作成。constexpr対応などでバージョン追従が必要だった
faithandbrave Aug 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions reference/algorithm/make_heap.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace std {


## テンプレートパラメータ制約
- `RandomAccessIterator` は `ValueSwappable` の要件を満たしていること
- `*first` の型は `MoveConstructible` と `MoveAssignable` の要件を満たしていること


Expand Down Expand Up @@ -150,3 +151,5 @@ void make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare co

## 参照
- [P0879R0 Constexpr for `swap` and `swap` related functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0879r0.html)
- [LWG Issue 3032. `ValueSwappable` requirement missing for `push_heap` and `make_heap`](https://cplusplus.github.io/LWG/issue3032)
- C++23で、`std`名前空間のオーバーロードについて`RandomAccessIterator`が`ValueSwappable`の要件を満たすことが事前条件として明記された
3 changes: 3 additions & 0 deletions reference/algorithm/push_heap.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace std {


## テンプレートパラメータ制約
- `RandomAccessIterator` は `ValueSwappable` の要件を満たしていること
- `*first` の型は `MoveConstructible` と `MoveAssignable` の要件を満たしていること


Expand Down Expand Up @@ -135,3 +136,5 @@ void push_heap(RandomAccessIterator first, RandomAccessIterator last, Compare co

## 参照
- [P0879R0 Constexpr for `swap` and `swap` related functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0879r0.html)
- [LWG Issue 3032. `ValueSwappable` requirement missing for `push_heap` and `make_heap`](https://cplusplus.github.io/LWG/issue3032)
- C++23で、`std`名前空間のオーバーロードについて`RandomAccessIterator`が`ValueSwappable`の要件を満たすことが事前条件として明記された
6 changes: 5 additions & 1 deletion reference/atomic/atomic_flag.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace std {
## 概要
`atomic_flag`クラスは、フラグを表現するためのアトミッククラスである。このクラスは、シンプルなtest-and-set (TAS) 機能を提供し、有効値の設定とクリアの2状態のみを持つ。このクラスに対する操作はロックフリーであることが保証される。(機能的には[`atomic<bool>`](atomic.md)クラスよりも貧弱だが、`atomic_flag`クラスの操作は必ずロックフリーである点が異なる。)

`atomic_flag`オブジェクトに対する操作は、常にロックフリーなアトミック操作(plainなロックフリーアトミック操作)に分類されるため、シグナルハンドラ内から安全に使用できる。


### メンバ関数
| 名前 | 説明 | 対応バージョン |
Expand Down Expand Up @@ -111,4 +113,6 @@ int main()
- 2012はコピーコンストラクタと代入演算子のdelete宣言が存在しない。


### 参照
## 参照
- [LWG Issue 3756. Is the `std::atomic_flag` class signal-safe?](https://cplusplus.github.io/LWG/issue3756)
- C++23で、`atomic_flag`(`is_lock_free()`を持たない)に対する操作が「plainなロックフリーアトミック操作」に含まれ、シグナルハンドラ内で安全に使用できることが明確化された
4 changes: 3 additions & 1 deletion reference/chrono/format.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ chrono-format-spec:
- `<` : 左寄せ
- `^` : 中央寄せ
- `width` (省略可) : 幅 (省略時は値に応じて幅が決まり、アライメントは機能しない)
- `precision` (省略可) : 精度(浮動小数点数の場合)、使う文字数(文字列の場合)
- `precision` (省略可) : 精度。`rep`が浮動小数点型である[`duration`](duration.md)の特殊化に対してのみ指定でき、それ以外の型に対して指定すると[`format_error`](../format/format_error.md)例外を送出する
- `L` (省略可) : この関数に指定されたロケールを使用し、指定されなければグローバルロケールを使用する。省略された場合はCロケールを使用する


Expand Down Expand Up @@ -149,3 +149,5 @@ int main()
- この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる
- [LWG Issue 3831. Two-digit formatting of negative `year` is ambiguous](https://cplusplus.github.io/LWG/issue3831)
- C++26で、`%y`が年の符号によらず年のうしろ2桁を表すことが明確化された。たとえば`std::format("{:%C %y}", -1976y)`は`"-20 76"`となる
- [LWG Issue 3842. Unclear wording for precision in `chrono-format-spec`](https://cplusplus.github.io/LWG/issue3842)
- C++23で、`precision`(精度)が`rep`を浮動小数点型とする`duration`の特殊化に対してのみ有効であることが明確化された
28 changes: 14 additions & 14 deletions reference/cinttypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@

| 名前 | 説明 | 対応バージョン |
|------|------|----------------|
| `imaxdiv_t` | `imaxdiv`関数の戻り値型 | C++11 |
| [`imaxdiv_t`](cinttypes/imaxdiv_t.md) | `imaxdiv`関数の戻り値型 | C++11 |


## 関数

| 名前 | 説明 | 対応バージョン |
|------|------|----------------|
| `imaxabs` | `intmax_t`の絶対値を取得する | C++11 |
| `imaxdiv` | `intmax_t`の除算と剰余算を行う | C++11 |
| `strtoimax` | 文字列を`intmax_t`に変換する | C++11 |
| `strtoumax` | 文字列を`uintmax_t`に変換する | C++11 |
| `wcstoimax` | ワイド文字列を`intmax_t`に変換する | C++11 |
| `wcstoumax` | ワイド文字列を`uintmax_t`に変換する | C++11 |
| `abs` | `intmax_t`の絶対値を取得する (`imaxabs`のオーバーロード、処理系定義) | C++11 |
| `div` | `intmax_t`の除算と剰余算を行う (`imaxdiv`のオーバーロード、処理系定義) | C++11 |
| [`imaxabs`](cinttypes/imaxabs.md) | `intmax_t`の絶対値を取得する | C++11 |
| [`imaxdiv`](cinttypes/imaxdiv.md) | `intmax_t`の除算と剰余算を行う | C++11 |
| [`strtoimax`](cinttypes/strtoimax.md) | 文字列を`intmax_t`に変換する | C++11 |
| [`strtoumax`](cinttypes/strtoumax.md) | 文字列を`uintmax_t`に変換する | C++11 |
| [`wcstoimax`](cinttypes/wcstoimax.md) | ワイド文字列を`intmax_t`に変換する | C++11 |
| [`wcstoumax`](cinttypes/wcstoumax.md) | ワイド文字列を`uintmax_t`に変換する | C++11 |
| [`abs`](cinttypes/imaxabs.md) | `intmax_t`の絶対値を取得する (`imaxabs`のオーバーロード、処理系定義) | C++11 |
| [`div`](cinttypes/imaxdiv.md) | `intmax_t`の除算と剰余算を行う (`imaxdiv`のオーバーロード、処理系定義) | C++11 |


## 出力用の書式指定マクロ
Expand All @@ -36,8 +36,8 @@
|------|------|----------------|
| `PRId`*N*, `PRIi`*N*, `PRIo`*N*, `PRIu`*N*, `PRIx`*N*, `PRIX`*N* | `intN_t` / `uintN_t`用 | C++11 |
| [`PRIb`*N*, `PRIB`*N*](cinttypes/prib.md) | `intN_t` / `uintN_t`用 (2進数) | C++26 |
| `PRIdLEAST`*N* 等, `PRIdFAST`*N* 等 | `int_leastN_t` / `int_fastN_t`系用 (2進数の`b`/`B`はC++26) | C++11 |
| `PRIdMAX` 等, `PRIdPTR` 等 | `intmax_t` / `intptr_t`系用 (2進数の`b`/`B`はC++26) | C++11 |
| `PRIdLEAST`*N* 等, `PRIdFAST`*N* 等 | `int_leastN_t` / `int_fastN_t`系用 | C++11 |
| `PRIdMAX` 等, `PRIdPTR` 等 | `intmax_t` / `intptr_t`系用 | C++11 |


## 入力用の書式指定マクロ
Expand All @@ -48,15 +48,15 @@
|------|------|----------------|
| `SCNd`*N*, `SCNi`*N*, `SCNo`*N*, `SCNu`*N*, `SCNx`*N* | `intN_t` / `uintN_t`用 | C++11 |
| [`SCNb`*N*](cinttypes/scnb.md) | `intN_t` / `uintN_t`用 (2進数) | C++26 |
| `SCNdLEAST`*N* 等, `SCNdFAST`*N* 等 | `int_leastN_t` / `int_fastN_t`系用 (2進数の`b`はC++26) | C++11 |
| `SCNdMAX` 等, `SCNdPTR` 等 | `intmax_t` / `intptr_t`系用 (2進数の`b`はC++26) | C++11 |
| `SCNdLEAST`*N* 等, `SCNdFAST`*N* 等 | `int_leastN_t` / `int_fastN_t`系用 | C++11 |
| `SCNdMAX` 等, `SCNdPTR` 等 | `intmax_t` / `intptr_t`系用 | C++11 |


## バージョン情報マクロ

| 名前 | 説明 | 対応バージョン |
|------|------|----------------|
| `__STDC_VERSION_INTTYPES_H__` | `<cinttypes>`が提供するC標準ライブラリ機能のバージョン (`202311L`) | C++26 |
| [`__STDC_VERSION_INTTYPES_H__`](cinttypes/stdc_version_inttypes_h.md) | `<cinttypes>`が提供するC標準ライブラリ機能のバージョン (`202311L`) | C++26 |


## バージョン
Expand Down
67 changes: 67 additions & 0 deletions reference/cinttypes/imaxabs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# imaxabs
* cinttypes[meta header]
* std[meta namespace]
* function[meta id-type]
* cpp11[meta cpp]

```cpp
namespace std {
intmax_t imaxabs(intmax_t j); // (1) C++11
constexpr intmax_t imaxabs(intmax_t j); // (1) C++23

intmax_t abs(intmax_t j); // (2) C++11
constexpr intmax_t abs(intmax_t j); // (2) C++23
}
```
* intmax_t[link /reference/cstdint/intmax_t.md]

## 概要
最大幅の符号付き整数型 [`intmax_t`](/reference/cstdint/intmax_t.md) の絶対値を求める。imaxabs は integer maximum absolute value(最大幅整数の絶対値)の略。

- (1) : [`intmax_t`](/reference/cstdint/intmax_t.md)に対するオーバーロード。
- (2) : (1)と同じ機能を持つ、`abs`という名前のオーバーロード。


## 戻り値
引数 `j` の絶対値を返す。


## 備考
- (2) : このオーバーロードは、[`intmax_t`](/reference/cstdint/intmax_t.md)が拡張整数型である場合にのみ宣言される。([`intmax_t`](/reference/cstdint/intmax_t.md)が`long`や`long long`のような標準の整数型である場合、[`<cstdlib>`](/reference/cstdlib.md)の`abs`のオーバーロードと重複するため宣言されない。)
- `j`の絶対値が[`intmax_t`](/reference/cstdint/intmax_t.md)で表現できない場合、動作は未定義である。
- 一般的な2の補数表現のシステムにおいて、[`intmax_t`](/reference/cstdint/intmax_t.md)の最小値の絶対値は、表現できる最大値よりも1大きくなってしまうため、この未定義動作に該当する。


## 例
```cpp example
#include <iostream>
#include <cinttypes>

int main()
{
std::intmax_t x = std::imaxabs(-1234);
std::cout << x << std::endl;
}
```
* std::imaxabs[color ff0000]

### 出力
```
1234
```


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


## 関連項目
- [`imaxdiv`](imaxdiv.md)
- [`abs - <cstdlib>`](/reference/cstdlib/abs.md)


## 参照
- [N1568 Proposed additions to TR-1 to improve compatibility with C99](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm)
- [LWG Issue 3834. Missing `constexpr` for `std::intmax_t` math functions in `<cinttypes>`](https://cplusplus.github.io/LWG/issue3834)
- C++23で、P0533R9が`<cmath>`・`<cstdlib>`を`constexpr`化した際に漏れていた`imaxabs`(および`abs`のオーバーロード)が`constexpr`化された
80 changes: 80 additions & 0 deletions reference/cinttypes/imaxdiv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# imaxdiv
* cinttypes[meta header]
* std[meta namespace]
* function[meta id-type]
* cpp11[meta cpp]

```cpp
namespace std {
imaxdiv_t
imaxdiv(intmax_t numer,
intmax_t denom); // (1) C++11
constexpr imaxdiv_t
imaxdiv(intmax_t numer,
intmax_t denom); // (1) C++23

imaxdiv_t
div(intmax_t numer,
intmax_t denom); // (2) C++11
constexpr imaxdiv_t
div(intmax_t numer,
intmax_t denom); // (2) C++23
}
```
* imaxdiv_t[link imaxdiv_t.md]
* intmax_t[link /reference/cstdint/intmax_t.md]

## 概要
最大幅の符号付き整数型 [`intmax_t`](/reference/cstdint/intmax_t.md) に対して、`numer / denom`と`numer % denom`の計算をひとつの操作で行う。imaxdiv は integer maximum division(最大幅整数の除算)の略。

- (1) : [`intmax_t`](/reference/cstdint/intmax_t.md)に対するオーバーロード。
- (2) : (1)と同じ機能を持つ、`div`という名前のオーバーロード。


## 戻り値
[`imaxdiv_t`](imaxdiv_t.md)型オブジェクトの`quot`に商、`rem`に剰余を代入して返す。

結果のどちらかが[`intmax_t`](/reference/cstdint/intmax_t.md)で表現できない場合、動作は未定義である。


## 備考
- (2) : このオーバーロードは、[`intmax_t`](/reference/cstdint/intmax_t.md)が拡張整数型である場合にのみ宣言される。([`intmax_t`](/reference/cstdint/intmax_t.md)が`long`や`long long`のような標準の整数型である場合、[`<cstdlib>`](/reference/cstdlib.md)の`div`のオーバーロードと重複するため宣言されない。)


## 例
```cpp example
#include <iostream>
#include <cinttypes>

int main()
{
std::imaxdiv_t x = std::imaxdiv(17, 5);
std::cout << x.quot << std::endl;
std::cout << x.rem << std::endl;
}
```
* std::imaxdiv[color ff0000]
* std::imaxdiv_t[link imaxdiv_t.md]

### 出力
```
3
2
```


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


## 関連項目
- [`imaxabs`](imaxabs.md)
- [`imaxdiv_t`](imaxdiv_t.md)
- [`div - <cstdlib>`](/reference/cstdlib/div.md)


## 参照
- [N1568 Proposed additions to TR-1 to improve compatibility with C99](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm)
- [LWG Issue 3834. Missing `constexpr` for `std::intmax_t` math functions in `<cinttypes>`](https://cplusplus.github.io/LWG/issue3834)
- C++23で、P0533R9が`<cmath>`・`<cstdlib>`を`constexpr`化した際に漏れていた`imaxdiv`(および`div`のオーバーロード)が`constexpr`化された
58 changes: 58 additions & 0 deletions reference/cinttypes/imaxdiv_t.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# imaxdiv_t
* cinttypes[meta header]
* std[meta namespace]
* class[meta id-type]
* cpp11[meta cpp]

```cpp
namespace std {
struct imaxdiv_t {
intmax_t quot;
intmax_t rem;
};
}
```
* intmax_t[link /reference/cstdint/intmax_t.md]

## 概要
[`std::imaxdiv()`](imaxdiv.md)関数の戻り値となる構造体型。

`quot`は「quotient (商)」、`rem`は「remainder (剰余)」を表す。

なお、メンバの宣言順序は未規定である。


## 例
```cpp example
#include <iostream>
#include <cinttypes>

int main()
{
std::imaxdiv_t x = std::imaxdiv(17, 5);
std::cout << x.quot << std::endl;
std::cout << x.rem << std::endl;
}
```
* std::imaxdiv_t[color ff0000]
* std::imaxdiv[link imaxdiv.md]

### 出力
```
3
2
```


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


## 関連項目
- [`imaxdiv`](imaxdiv.md)
- [`div_t`](/reference/cstdlib/div_t.md)


## 参照
- [N1568 Proposed additions to TR-1 to improve compatibility with C99](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm)
25 changes: 25 additions & 0 deletions reference/cinttypes/stdc_version_inttypes_h.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# __STDC_VERSION_INTTYPES_H__
* cinttypes[meta header]
* macro[meta id-type]
* cpp26[meta cpp]

```cpp
#define __STDC_VERSION_INTTYPES_H__ 202311L
```

## 概要
`<cinttypes>`ヘッダが提供するC標準ライブラリ機能がC23の基準に準拠していることを示すマクロ。


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


## 関連項目
- [`<cinttypes>`](../cinttypes.md)


## 参照
- [P3348R4 C++26 should refer to C23 not C17](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3348r4.pdf)
- C++26がC23を参照するようになり、このマクロが追加された
Loading