Skip to content

Commit debf1bd

Browse files
committed
C++26対応として、標準ライブラリのnodiscard指定を削除 (close #1386)
1 parent 15399ca commit debf1bd

File tree

58 files changed

+405
-76
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+405
-76
lines changed

reference/array/array/empty.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
constexpr bool empty() noexcept; // C++11
1010
constexpr bool empty() const noexcept; // C++14
1111
[[nodiscard]] constexpr bool empty() const noexcept; // C++20
12+
constexpr bool empty() const noexcept; // C++26
1213
```
1314

1415
## 概要
@@ -68,3 +69,6 @@ empty_array : true
6869
## 参照
6970
- [N3669 Fixing constexpr member functions without const](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3669.pdf)
7071
- [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf)
72+
- C++20で`[[nodiscard]]`が付加された
73+
- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html)
74+
- C++26で`[[nodiscard]]`指定が削除された

reference/barrier/barrier/arrive.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
* cpp20[meta cpp]
77

88
```cpp
9-
[[nodiscard]] arrival_token arrive(ptrdiff_t update = 1);
9+
[[nodiscard]]
10+
arrival_token arrive(ptrdiff_t update = 1); // (1) C++20
11+
arrival_token arrive(ptrdiff_t update = 1); // (1) C++26
1012
```
1113
* ptrdiff_t[link /reference/cstddef/ptrdiff_t.md]
1214
@@ -121,3 +123,8 @@ main: phase-2
121123
- [`wait()`](wait.md)
122124
- [`arrive_and_wait()`](arrive_and_wait.md)
123125
- [`arrive_and_drop()`](arrive_and_drop.md)
126+
127+
128+
## 参照
129+
- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html)
130+
- C++26で`[[nodiscard]]`指定が削除された

reference/bit/rotl.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
```cpp
88
namespace std {
99
template <class T>
10-
[[nodiscard]] constexpr T rotl(T x, int s) noexcept;
10+
[[nodiscard]]
11+
constexpr T rotl(T x, int s) noexcept; // (1) C++20
12+
template <class T>
13+
constexpr T rotl(T x, int s) noexcept; // (1) C++26
1114
}
1215
```
1316
@@ -73,3 +76,5 @@ int main()
7376

7477
## 参照
7578
- [P0553R4 Bit operations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0553r4.html)
79+
- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html)
80+
- C++26で`[[nodiscard]]`指定が削除された

reference/bit/rotr.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
```cpp
88
namespace std {
99
template <class T>
10-
[[nodiscard]] constexpr T rotr(T x, int s) noexcept;
10+
[[nodiscard]]
11+
constexpr T rotr(T x, int s) noexcept; // (1) C++20
12+
template <class T>
13+
constexpr T rotr(T x, int s) noexcept; // (1) C++26
1114
}
1215
```
1316
@@ -73,3 +76,5 @@ int main()
7376

7477
## 参照
7578
- [P0553R4 Bit operations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0553r4.html)
79+
- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html)
80+
- C++26で`[[nodiscard]]`指定が削除された

reference/deque/deque/empty.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
bool empty() const; // C++03
99
bool empty() const noexcept; // C++11
1010
[[nodiscard]] bool empty() const noexcept; // C++20
11+
bool empty() const noexcept; // C++26
1112
```
1213

1314
## 概要
@@ -66,3 +67,6 @@ false
6667

6768
## 参照
6869
- [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf)
70+
- C++20で`[[nodiscard]]`が付加された
71+
- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html)
72+
- C++26で`[[nodiscard]]`指定が削除された

reference/filesystem/path/empty.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
```cpp
99
bool empty() const noexcept; // C++17
1010
[[nodiscard]] bool empty() const noexcept; // C++20
11+
bool empty() const noexcept; // C++26
1112
```
1213

1314
## 概要
@@ -58,3 +59,6 @@ p2 : not empty
5859

5960
## 参照
6061
- [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf)
62+
- C++20で`[[nodiscard]]`が付加された
63+
- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html)
64+
- C++26で`[[nodiscard]]`指定が削除された

reference/forward_list/forward_list/empty.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
```cpp
99
bool empty() const noexcept; // C++11
1010
[[nodiscard]] bool empty() const noexcept; // C++20
11+
bool empty() const noexcept; // C++26
1112
```
1213

1314
## 概要
@@ -68,3 +69,6 @@ false
6869

6970
## 参照
7071
- [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf)
72+
- C++20で`[[nodiscard]]`が付加された
73+
- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html)
74+
- C++26で`[[nodiscard]]`指定が削除された

reference/future/async.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,41 @@ namespace std {
99
template <class F, class... Args>
1010
future<typename result_of<F(Args...)>::type>
1111
async(F&& f, Args&&... args); // (1) C++11
12-
1312
template <class F, class... Args>
1413
future<
1514
typename result_of<
1615
typename decay<F>::type(typename decay<Args>::type...)
1716
>::type
1817
> async(F&& f, Args&&... args); // (1) C++14
19-
2018
template <class F, class... Args>
2119
future<invoke_result_t<decay_t<F>, decay_t<Args>...>>
2220
async(F&& f, Args&&... args); // (1) C++17
23-
2421
template <class F, class... Args>
25-
[[nodiscard]] future<invoke_result_t<decay_t<F>, decay_t<Args>...>>
22+
[[nodiscard]]
23+
future<invoke_result_t<decay_t<F>, decay_t<Args>...>>
2624
async(F&& f, Args&&... args); // (1) C++20
25+
future<invoke_result_t<decay_t<F>, decay_t<Args>...>>
26+
async(F&& f, Args&&... args); // (1) C++26
2727

2828

2929
template <class F, class... Args>
3030
future<typename result_of<F(Args...)>::type>
3131
async(launch policy, F&& f, Args&&... args); // (2) C++11
32-
3332
template <class F, class... Args>
3433
future<
3534
typename result_of<
3635
typename decay<F>::type(typename decay<Args>::type...)
3736
>::type
3837
> async(launch policy, F&& f, Args&&... args); // (2) C++14
39-
4038
template <class F, class... Args>
4139
future<invoke_result_t<decay_t<F>, decay_t<Args>...>>
4240
async(launch policy, F&& f, Args&&... args); // (2) C++17
43-
4441
template <class F, class... Args>
45-
[[nodiscard]] future<invoke_result_t<decay_t<F>, decay_t<Args>...>>
42+
[[nodiscard]]
43+
future<invoke_result_t<decay_t<F>, decay_t<Args>...>>
4644
async(launch policy, F&& f, Args&&... args); // (2) C++20
45+
future<invoke_result_t<decay_t<F>, decay_t<Args>...>>
46+
async(launch policy, F&& f, Args&&... args); // (2) C++26
4747
}
4848
```
4949
* future[link future.md]
@@ -203,5 +203,8 @@ foo() = 3
203203
- [async関数launch::asyncポリシーとfutureのちょっと特殊な動作 - yohhoyの日記](https://yohhoy.hatenadiary.jp/entry/20120317/p1)
204204
- [P0604R0 Resolving GB 55, US 84, US 85, US 86](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0604r0.html)
205205
- [P0600R1 `[[nodiscard]]` in the Library, Rev1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf)
206+
- C++20で`[[nodiscard]]`が付加された
206207
- [In Visual Studio, `thread_local` variables' destructor not called when used with `std::async`, is this a bug? - stackoverflow](https://stackoverflow.com/questions/50897768/in-visual-studio-thread-local-variables-destructor-not-called-when-used-with)
207208
- [&lt;future&gt; functions - Microsoft Docs](https://docs.microsoft.com/en-us/cpp/standard-library/future-functions?view=vs-2019#remarks)
209+
- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html)
210+
- C++26で`[[nodiscard]]`指定が削除された

reference/iterator/empty.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,24 @@
88
namespace std {
99
template <class C>
1010
constexpr auto empty(const C& c) -> decltype(c.empty()); // (1) C++17
11-
1211
template <class C>
1312
[[nodiscard]] constexpr auto empty(const C& c) -> decltype(c.empty()); // (1) C++20
13+
template <class C>
14+
constexpr auto empty(const C& c) -> decltype(c.empty()); // (1) C++26
1415

1516
template <class T, std::size_t N>
1617
constexpr bool empty(const T (&array)[N]) noexcept; // (2) C++17
17-
1818
template <class T, std::size_t N>
1919
[[nodiscard]] constexpr bool empty(const T (&array)[N]) noexcept; // (2) C++20
20+
template <class T, std::size_t N>
21+
constexpr bool empty(const T (&array)[N]) noexcept; // (2) C++26
2022

2123
template <class E>
2224
constexpr bool empty(initializer_list<E> il) noexcept; // (3) C++17
23-
2425
template <class E>
2526
[[nodiscard]] constexpr bool empty(initializer_list<E> il) noexcept; // (3) C++20
27+
template <class E>
28+
constexpr bool empty(initializer_list<E> il) noexcept; // (3) C++26
2629
}
2730
```
2831
* initializer_list[link /reference/initializer_list/initializer_list.md]
@@ -102,4 +105,7 @@ false
102105
- [`boost::empty()` - Boost Range Library](http://www.boost.org/doc/libs/release/libs/range/doc/html/range/reference/concept_implementation/semantics/functions.html)
103106
- [N4280: Non-member `empty()` and more (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4280.pdf)
104107
- [P0600R1: `[[nodiscard]]` in the library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf)
108+
- C++20で`[[nodiscard]]`が付加された
105109
- [LWG Issue 3009. Including `<string_view>` doesn't provide `std::size/empty/data`](https://wg21.cmeerw.net/lwg/issue3009)
110+
- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html)
111+
- C++26で`[[nodiscard]]`指定が削除された

reference/list/list/empty.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
bool empty() const; // C++03
99
bool empty() const noexcept; // C++11
1010
[[nodiscard]] bool empty() const noexcept; // C++20
11+
bool empty() const noexcept; // C++26
1112
```
1213

1314
## 概要
@@ -57,3 +58,6 @@ false
5758

5859
## 参照
5960
- [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf)
61+
- C++20で`[[nodiscard]]`が付加された
62+
- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html)
63+
- C++26で`[[nodiscard]]`指定が削除された

0 commit comments

Comments
 (0)