Skip to content

Commit

Permalink
atomic : C++26のconstexpr対応 (close #1391)
Browse files Browse the repository at this point in the history
  • Loading branch information
faithandbrave committed Dec 23, 2024
1 parent d440b08 commit 4324757
Show file tree
Hide file tree
Showing 96 changed files with 974 additions and 331 deletions.
57 changes: 38 additions & 19 deletions reference/atomic/atomic/compare_exchange_strong.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,42 @@
* cpp11[meta cpp]

```cpp
bool compare_exchange_strong(T& expected,
T desired,
memory_order success,
memory_order failure
) volatile noexcept; // (1) C++11
bool compare_exchange_strong(T& expected,
T desired,
memory_order success,
memory_order failure
) noexcept; // (2) C++11

bool compare_exchange_strong(T& expected,
T desired,
memory_order order = memory_order_seq_cst
) volatile noexcept; // (3) C++11
bool compare_exchange_strong(T& expected,
T desired,
memory_order order = memory_order_seq_cst
) noexcept; // (4) C++11
bool
compare_exchange_strong(T& expected,
T desired,
memory_order success,
memory_order failure
) volatile noexcept; // (1) C++11

bool
compare_exchange_strong(T& expected,
T desired,
memory_order success,
memory_order failure
) noexcept; // (2) C++11
constexpr bool
compare_exchange_strong(T& expected,
T desired,
memory_order success,
memory_order failure
) noexcept; // (2) C++26

bool
compare_exchange_strong(T& expected,
T desired,
memory_order order = memory_order_seq_cst
) volatile noexcept; // (3) C++11

bool
compare_exchange_strong(T& expected,
T desired,
memory_order order = memory_order_seq_cst
) noexcept; // (4) C++11
constexpr bool
compare_exchange_strong(T& expected,
T desired,
memory_order order = memory_order_seq_cst
) noexcept; // (4) C++26
```
* memory_order[link /reference/atomic/memory_order.md]
* memory_order_seq_cst[link /reference/atomic/memory_order.md]
Expand Down Expand Up @@ -180,3 +197,5 @@ true
- [Understand `std::atomic::compare_exchange_weak()` in C++11 - Eric Z's blog](https://tonywearme.wordpress.com/2014/08/15/understand-stdatomiccompare_exchange_weak-in-c11/)
- [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html)
- C++20での、`volatile`版への制約追加
- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html)
- C++26で`constexpr`に対応した
57 changes: 38 additions & 19 deletions reference/atomic/atomic/compare_exchange_weak.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,42 @@
* cpp11[meta cpp]

```cpp
bool compare_exchange_weak(T& expected,
T desired,
memory_order success,
memory_order failure
) volatile noexcept; // (1) C++11
bool compare_exchange_weak(T& expected,
T desired,
memory_order success,
memory_order failure
) noexcept; // (2) C++11

bool compare_exchange_weak(T& expected,
T desired,
memory_order order = memory_order_seq_cst
) volatile noexcept; // (3) C++11
bool compare_exchange_weak(T& expected,
T desired,
memory_order order = memory_order_seq_cst
) noexcept; // (4) C++11
bool
compare_exchange_weak(T& expected,
T desired,
memory_order success,
memory_order failure
) volatile noexcept; // (1) C++11

bool
compare_exchange_weak(T& expected,
T desired,
memory_order success,
memory_order failure
) noexcept; // (2) C++11
constexpr bool
compare_exchange_weak(T& expected,
T desired,
memory_order success,
memory_order failure
) noexcept; // (2) C++26

bool
compare_exchange_weak(T& expected,
T desired,
memory_order order = memory_order_seq_cst
) volatile noexcept; // (3) C++11

bool
compare_exchange_weak(T& expected,
T desired,
memory_order order = memory_order_seq_cst
) noexcept; // (4) C++11
constexpr bool
compare_exchange_weak(T& expected,
T desired,
memory_order order = memory_order_seq_cst
) noexcept; // (4) C++26
```
* memory_order[link /reference/atomic/memory_order.md]
* memory_order_seq_cst[link /reference/atomic/memory_order.md]
Expand Down Expand Up @@ -205,3 +222,5 @@ int main()
- [Understand `std::atomic::compare_exchange_weak()` in C++11 - Eric Z's blog](https://tonywearme.wordpress.com/2014/08/15/understand-stdatomiccompare_exchange_weak-in-c11/)
- [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html)
- C++20での、`volatile`版への制約追加
- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html)
- C++26で`constexpr`に対応した
13 changes: 11 additions & 2 deletions reference/atomic/atomic/exchange.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@
* cpp11[meta cpp]

```cpp
T exchange(T desired,
T
exchange(T desired,
memory_order order = memory_order_seq_cst
) volatile noexcept; // (1) C++11
T exchange(T desired,

T
exchange(T desired,
memory_order order = memory_order_seq_cst
) noexcept; // (2) C++11
constexpr T
exchange(T desired,
memory_order order = memory_order_seq_cst
) noexcept; // (2) C++26
```
* memory_order[link /reference/atomic/memory_order.md]
* memory_order_seq_cst[link /reference/atomic/memory_order.md]
Expand Down Expand Up @@ -81,3 +88,5 @@ replaced 1 by 2
## 参照
- [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html)
- C++20での、`volatile`版への制約追加
- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html)
- C++26で`constexpr`に対応した
13 changes: 11 additions & 2 deletions reference/atomic/atomic/fetch_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@
* cpp11[meta cpp]

```cpp
T fetch_add(difference_type operand,
T
fetch_add(difference_type operand,
memory_order order = memory_order_seq_cst
) volatile noexcept; // (1) C++11
T fetch_add(difference_type operand,

T
fetch_add(difference_type operand,
memory_order order = memory_order_seq_cst
) noexcept; // (2) C++11
constexpr T
fetch_add(difference_type operand,
memory_order order = memory_order_seq_cst
) noexcept; // (2) C++26
```
* memory_order[link /reference/atomic/memory_order.md]
* memory_order_seq_cst[link /reference/atomic/memory_order.md]
Expand Down Expand Up @@ -154,3 +161,5 @@ int main()
- C++20での、浮動小数点数版の追加
- [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html)
- C++20での、`volatile`版への制約追加
- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html)
- C++26で`constexpr`に対応した
13 changes: 11 additions & 2 deletions reference/atomic/atomic/fetch_and.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@
* cpp11[meta cpp]

```cpp
T fetch_and(T operand,
T
fetch_and(T operand,
memory_order order = memory_order_seq_cst
) volatile noexcept; // (1) C++11
T fetch_and(T operand,

T
fetch_and(T operand,
memory_order order = memory_order_seq_cst
) noexcept; // (2) C++11
constexpr T
fetch_and(T operand,
memory_order order = memory_order_seq_cst
) noexcept; // (2) C++26
```
* memory_order[link /reference/atomic/memory_order.md]
* memory_order_seq_cst[link /reference/atomic/memory_order.md]
Expand Down Expand Up @@ -131,3 +138,5 @@ int main()
- C++17での、オブジェクト型であることの制約追加
- [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html)
- C++20での、`volatile`版への制約追加
- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html)
- C++26で`constexpr`に対応した
4 changes: 3 additions & 1 deletion reference/atomic/atomic/fetch_max.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* cpp26[meta cpp]

```cpp
T fetch_max(difference_type operand,
constexpr T
fetch_max(difference_type operand,
memory_order order = memory_order_seq_cst
) const noexcept; // (1) C++26
```
Expand Down Expand Up @@ -70,3 +71,4 @@ int main()

## 参照
- [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf)
- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html)
4 changes: 3 additions & 1 deletion reference/atomic/atomic/fetch_min.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* cpp26[meta cpp]

```cpp
T fetch_min(difference_type operand,
constexpr T
fetch_min(difference_type operand,
memory_order order = memory_order_seq_cst
) const noexcept; // (1) C++26
```
Expand Down Expand Up @@ -70,3 +71,4 @@ int main()

## 参照
- [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf)
- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html)
13 changes: 11 additions & 2 deletions reference/atomic/atomic/fetch_or.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@
* cpp11[meta cpp]

```cpp
T fetch_or(T operand,
T
fetch_or(T operand,
memory_order order = memory_order_seq_cst
) volatile noexcept; // (1) C++11
T fetch_or(T operand,

T
fetch_or(T operand,
memory_order order = memory_order_seq_cst
) noexcept; // (2) C++11
constexpr T
fetch_or(T operand,
memory_order order = memory_order_seq_cst
) noexcept; // (2) C++26
```
* memory_order[link /reference/atomic/memory_order.md]
* memory_order_seq_cst[link /reference/atomic/memory_order.md]
Expand Down Expand Up @@ -131,3 +138,5 @@ int main()
- C++17での、オブジェクト型であることの制約追加
- [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html)
- C++20での、`volatile`版への制約追加
- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html)
- C++26で`constexpr`に対応した
13 changes: 11 additions & 2 deletions reference/atomic/atomic/fetch_sub.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@
* cpp11[meta cpp]

```cpp
T fetch_sub(difference_type operand,
T
fetch_sub(difference_type operand,
memory_order order = memory_order_seq_cst
) volatile noexcept; // (1) C++11
T fetch_sub(difference_type operand,

T
fetch_sub(difference_type operand,
memory_order order = memory_order_seq_cst
) noexcept; // (2) C++11
constexpr T
fetch_sub(difference_type operand,
memory_order order = memory_order_seq_cst
) noexcept; // (2) C++26
```
* memory_order[link /reference/atomic/memory_order.md]
* memory_order_seq_cst[link /reference/atomic/memory_order.md]
Expand Down Expand Up @@ -151,3 +158,5 @@ int main()
- C++20での、浮動小数点数版の追加
- [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html)
- C++20での、`volatile`版への制約追加
- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html)
- C++26で`constexpr`に対応した
13 changes: 11 additions & 2 deletions reference/atomic/atomic/fetch_xor.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@
* cpp11[meta cpp]

```cpp
T fetch_xor(T operand,
T
fetch_xor(T operand,
memory_order order = memory_order_seq_cst
) volatile noexcept; // (1) C++11
T fetch_xor(T operand,

T
fetch_xor(T operand,
memory_order order = memory_order_seq_cst
) noexcept; // (2) C++11
constexpr T
fetch_xor(T operand,
memory_order order = memory_order_seq_cst
) noexcept; // (2) C++26
```
* memory_order[link /reference/atomic/memory_order.md]
* memory_order_seq_cst[link /reference/atomic/memory_order.md]
Expand Down Expand Up @@ -133,3 +140,5 @@ int main()
- C++17での、オブジェクト型であることの制約追加
- [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html)
- C++20での、`volatile`版への制約追加
- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html)
- C++26で`constexpr`に対応した
12 changes: 10 additions & 2 deletions reference/atomic/atomic/load.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
* cpp11[meta cpp]

```cpp
T load(memory_order order = memory_order_seq_cst
T
load(memory_order order = memory_order_seq_cst
) const volatile noexcept; // (1) C++11
T load(memory_order order = memory_order_seq_cst

T
load(memory_order order = memory_order_seq_cst
) const noexcept; // (2) C++11
constexpr T
load(memory_order order = memory_order_seq_cst
) const noexcept; // (2) C++26
```
* memory_order[link /reference/atomic/memory_order.md]
* memory_order_seq_cst[link /reference/atomic/memory_order.md]
Expand Down Expand Up @@ -82,3 +88,5 @@ int main()
## 参照
- [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html)
- C++20での、`volatile`版への制約追加
- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html)
- C++26で`constexpr`に対応した
8 changes: 6 additions & 2 deletions reference/atomic/atomic/notify_all.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
* cpp20[meta cpp]

```cpp
void notify_all() volatile noexcept; // (1) C++20
void notify_all() noexcept; // (2) C++20
void notify_all() volatile noexcept; // (1) C++20

void notify_all() noexcept; // (2) C++20
constexpr void notify_all() noexcept; // (2) C++26
```

## 概要
Expand Down Expand Up @@ -91,3 +93,5 @@ int main()
- [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait)
- [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html)
- C++20での、`volatile`版への制約追加
- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html)
- C++26で`constexpr`に対応した
8 changes: 6 additions & 2 deletions reference/atomic/atomic/notify_one.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
* cpp20[meta cpp]

```cpp
void notify_one() volatile noexcept; // (1) C++20
void notify_one() noexcept; // (2) C++20
void notify_one() volatile noexcept; // (1) C++20

void notify_one() noexcept; // (2) C++20
constexpr void notify_one() noexcept; // (2) C++26
```

## 概要
Expand Down Expand Up @@ -117,3 +119,5 @@ int main()
- [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait)
- [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html)
- C++20での、`volatile`版への制約追加
- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html)
- C++26で`constexpr`に対応した
Loading

0 comments on commit 4324757

Please sign in to comment.