Skip to content

Commit 6f2372b

Browse files
committed
C++26対応として、未初期化領域アルゴリズムをconstexpr対応 (close #1389)
1 parent 5142d43 commit 6f2372b

20 files changed

+257
-40
lines changed

reference/memory/ranges_uninitialized_copy.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,35 @@ namespace std::ranges {
1313
no-throw-forward-iterator O, no-throw-sentinel<O> S2>
1414
requires constructible_from<iter_value_t<O>, iter_reference_t<I>>
1515
uninitialized_copy_result<I, O>
16-
uninitialized_copy(I ifirst, S1 ilast, O ofirst, S2 olast); // (1) C++20
16+
uninitialized_copy(I ifirst,
17+
S1 ilast,
18+
O ofirst,
19+
S2 olast); // (1) C++20
20+
template <input_iterator I, sentinel_for<I> S1,
21+
no-throw-forward-iterator O, no-throw-sentinel<O> S2>
22+
requires constructible_from<iter_value_t<O>, iter_reference_t<I>>
23+
constexpr uninitialized_copy_result<I, O>
24+
uninitialized_copy(I ifirst,
25+
S1 ilast,
26+
O ofirst,
27+
S2 olast); // (1) C++26
1728

1829
template <input_range IR, no-throw-forward-range OR>
1930
requires constructible_from<range_value_t<OR>, range_reference_t<IR>>
20-
uninitialized_copy_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
21-
uninitialized_copy(IR&& in_range, OR&& out_range); // (2) C++20
31+
uninitialized_copy_result<
32+
borrowed_iterator_t<IR>,
33+
borrowed_iterator_t<OR>
34+
>
35+
uninitialized_copy(IR&& in_range,
36+
OR&& out_range); // (2) C++20
37+
template <input_range IR, no-throw-forward-range OR>
38+
requires constructible_from<range_value_t<OR>, range_reference_t<IR>>
39+
constexpr uninitialized_copy_result<
40+
borrowed_iterator_t<IR>,
41+
borrowed_iterator_t<OR>
42+
>
43+
uninitialized_copy(IR&& in_range,
44+
OR&& out_range); // (2) C++26
2245
}
2346
```
2447
* in_out_result[link /reference/algorithm/ranges_in_out_result.md]
@@ -152,3 +175,5 @@ int main()
152175

153176
## 参照
154177
- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf)
178+
- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html)
179+
- C++26から`constexpr`がついた

reference/memory/ranges_uninitialized_copy_n.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ namespace std::ranges {
2020
O ofirst,
2121
S olast
2222
); // (1) C++20
23+
template <input_iterator I,
24+
no-throw-forward-iterator O,
25+
no-throw-sentinel<O> S>
26+
requires constructible_from<iter_value_t<O>, iter_reference_t<I>>
27+
constexpr uninitialized_copy_n_result<I, O>
28+
uninitialized_copy_n(
29+
I ifirst,
30+
iter_difference_t<I> n,
31+
O ofirst,
32+
S olast
33+
); // (1) C++26
2334
}
2435
```
2536
* in_out_result[link /reference/algorithm/ranges_in_out_result.md]
@@ -131,3 +142,5 @@ int main()
131142

132143
## 参照
133144
- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf)
145+
- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html)
146+
- C++26から`constexpr`がついた

reference/memory/ranges_uninitialized_default_construct.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,21 @@
88
namespace std::ranges {
99
template <no-throw-forward-iterator I, no-throw-sentinel<I> S>
1010
requires default_initializable<iter_value_t<I>>
11-
I uninitialized_default_construct(I first, S last); // (1) C++20
11+
I
12+
uninitialized_default_construct(I first, S last); // (1) C++20
13+
template <no-throw-forward-iterator I, no-throw-sentinel<I> S>
14+
requires default_initializable<iter_value_t<I>>
15+
constexpr I
16+
uninitialized_default_construct(I first, S last); // (1) C++26
1217

1318
template <no-throw-forward-range R>
1419
requires default_initializable<range_value_t<R>>
15-
borrowed_iterator_t<R> uninitialized_default_construct(R&& r); // (2) C++20
20+
borrowed_iterator_t<R>
21+
uninitialized_default_construct(R&& r); // (2) C++20
22+
template <no-throw-forward-range R>
23+
requires default_initializable<range_value_t<R>>
24+
constexpr borrowed_iterator_t<R>
25+
uninitialized_default_construct(R&& r); // (2) C++26
1626
}
1727
```
1828
* no-throw-forward-iterator[link no-throw-forward-iterator.md]
@@ -135,3 +145,6 @@ int main()
135145
136146
## 参照
137147
- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf)
148+
- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html)
149+
- [P3369R0 `constexpr` for `uninitialized_default_construct`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3369r0.html)
150+
- 上記2文書で、C++26から`constexpr`がついた

reference/memory/ranges_uninitialized_default_construct_n.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88
namespace std::ranges {
99
template <no-throw-forward-iterator I>
1010
requires default_initializable<iter_value_t<I>>
11-
I uninitialized_default_construct_n(I first, iter_difference_t<I> n); // (1) C++20
11+
I
12+
uninitialized_default_construct_n(I first,
13+
iter_difference_t<I> n); // (1) C++20
14+
template <no-throw-forward-iterator I>
15+
requires default_initializable<iter_value_t<I>>
16+
constexpr I
17+
uninitialized_default_construct_n(I first,
18+
iter_difference_t<I> n); // (1) C++26
1219
}
1320
```
1421
* no-throw-forward-iterator[link no-throw-forward-iterator.md]
@@ -105,3 +112,6 @@ int main()
105112
106113
## 参照
107114
- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf)
115+
- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html)
116+
- [P3369R0 `constexpr` for `uninitialized_default_construct`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3369r0.html)
117+
- 上記2文書で、C++26から`constexpr`がついた

reference/memory/ranges_uninitialized_fill.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,23 @@ namespace std::ranges {
1010
no-throw-sentinel<I> S,
1111
class T>
1212
requires constructible_from<iter_value_t<I>, const T&>
13-
I uninitialized_fill(I first, S last, const T& x); // (1) C++20
13+
I uninitialized_fill(I first, S last, const T& x); // (1) C++20
14+
template <no-throw-forward-iterator I,
15+
no-throw-sentinel<I> S,
16+
class T>
17+
requires constructible_from<iter_value_t<I>, const T&>
18+
I uninitialized_fill(I first, S last, const T& x); // (1) C++26
1419

1520
template <no-throw-forward-range R,
1621
class T>
1722
requires constructible_from<range_value_t<R>, const T&>
18-
borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x); // (2) C++20
23+
borrowed_iterator_t<R>
24+
uninitialized_fill(R&& r, const T& x); // (2) C++20
25+
template <no-throw-forward-range R,
26+
class T>
27+
requires constructible_from<range_value_t<R>, const T&>
28+
constexpr borrowed_iterator_t<R>
29+
uninitialized_fill(R&& r, const T& x); // (2) C++26
1930
}
2031
```
2132
* no-throw-forward-iterator[link no-throw-forward-iterator.md]
@@ -130,3 +141,5 @@ int main()
130141

131142
## 参照
132143
- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf)
144+
- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html)
145+
- C++26から`constexpr`がついた

reference/memory/ranges_uninitialized_fill_n.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@
88
namespace std::ranges {
99
template <no-throw-forward-iterator I, class T>
1010
requires constructible_from<iter_value_t<I>, const T&>
11-
I uninitialized_fill_n(I first, iter_difference_t<I> n, const T& x); // (1) C++20
11+
I
12+
uninitialized_fill_n(I first,
13+
iter_difference_t<I> n,
14+
const T& x); // (1) C++20
15+
template <no-throw-forward-iterator I, class T>
16+
requires constructible_from<iter_value_t<I>, const T&>
17+
constexpr I
18+
uninitialized_fill_n(I first,
19+
iter_difference_t<I> n,
20+
const T& x); // (1) C++26
1221
}
1322
```
1423
* no-throw-forward-iterator[link no-throw-forward-iterator.md]
@@ -100,3 +109,5 @@ int main()
100109

101110
## 参照
102111
- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf)
112+
- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html)
113+
- C++26から`constexpr`がついた

reference/memory/ranges_uninitialized_move.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,26 @@ namespace std::ranges {
1414
requires constructible_from<iter_value_t<O>, iter_rvalue_reference_t<I>>
1515
uninitialized_move_result<I, O>
1616
uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast); // (1) C++20
17+
template <input_iterator I, sentinel_for<I> S1,
18+
no-throw-forward-iterator O, no-throw-sentinel<O> S2>
19+
requires constructible_from<iter_value_t<O>, iter_rvalue_reference_t<I>>
20+
constexpr uninitialized_move_result<I, O>
21+
uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast); // (1) C++26
1722

1823
template <input_range IR, no-throw-forward-range OR>
1924
requires constructible_from<range_value_t<OR>, range_rvalue_reference_t<IR>>
20-
uninitialized_move_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
25+
uninitialized_move_result<
26+
borrowed_iterator_t<IR>,
27+
borrowed_iterator_t<OR>
28+
>
2129
uninitialized_move(IR&& in_range, OR&& out_range); // (2) C++20
30+
template <input_range IR, no-throw-forward-range OR>
31+
requires constructible_from<range_value_t<OR>, range_rvalue_reference_t<IR>>
32+
constexpr uninitialized_move_result<
33+
borrowed_iterator_t<IR>,
34+
borrowed_iterator_t<OR>
35+
>
36+
uninitialized_move(IR&& in_range, OR&& out_range); // (2) C++26
2237
}
2338
```
2439
* in_out_result[link /reference/algorithm/ranges_in_out_result.md]
@@ -154,3 +169,5 @@ int main()
154169

155170
## 参照
156171
- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf)
172+
- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html)
173+
- C++26から`constexpr`がついた

reference/memory/ranges_uninitialized_move_n.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ namespace std::ranges {
2020
O ofirst,
2121
S olast
2222
); // (1) C++20
23+
template <input_iterator I,
24+
no-throw-forward-iterator O,
25+
no-throw-sentinel<O> S>
26+
requires constructible_from<iter_value_t<O>, iter_rvalue_reference_t<I>>
27+
constexpr uninitialized_move_n_result<I, O>
28+
uninitialized_move_n(
29+
I ifirst,
30+
iter_difference_t<I> n,
31+
O ofirst,
32+
S olast
33+
); // (1) C++26
2334
}
2435
```
2536
* in_out_result[link /reference/algorithm/ranges_in_out_result.md]
@@ -132,3 +143,5 @@ int main()
132143

133144
## 参照
134145
- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf)
146+
- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html)
147+
- C++26から`constexpr`がついた

reference/memory/ranges_uninitialized_value_construct.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,21 @@
88
namespace std::ranges {
99
template <no-throw-forward-iterator I, no-throw-sentinel<I> S>
1010
requires default_initializable<iter_value_t<I>>
11-
I uninitialized_value_construct(I first, S last); // (1) C++20
11+
I
12+
uninitialized_value_construct(I first, S last); // (1) C++20
13+
template <no-throw-forward-iterator I, no-throw-sentinel<I> S>
14+
requires default_initializable<iter_value_t<I>>
15+
constexpr I
16+
uninitialized_value_construct(I first, S last); // (1) C++26
1217

1318
template <no-throw-forward-range R>
1419
requires default_initializable<range_value_t<R>>
15-
borrowed_iterator_t<R> uninitialized_value_construct(R&& r); // (2) C++20
20+
borrowed_iterator_t<R>
21+
uninitialized_value_construct(R&& r); // (2) C++20
22+
template <no-throw-forward-range R>
23+
requires default_initializable<range_value_t<R>>
24+
constexpr borrowed_iterator_t<R>
25+
uninitialized_value_construct(R&& r); // (2) C++26
1626
}
1727
```
1828
* no-throw-forward-iterator[link no-throw-forward-iterator.md]
@@ -131,3 +141,5 @@ int main()
131141
132142
## 参照
133143
- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf)
144+
- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html)
145+
- C++26から`constexpr`がついた

reference/memory/ranges_uninitialized_value_construct_n.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88
namespace std::ranges {
99
template <no-throw-forward-iterator I>
1010
requires default_initializable<iter_value_t<I>>
11-
I uninitialized_value_construct_n(I first, iter_difference_t<I> n); // (1) C++20
11+
I
12+
uninitialized_value_construct_n(I first,
13+
iter_difference_t<I> n); // (1) C++20
14+
template <no-throw-forward-iterator I>
15+
requires default_initializable<iter_value_t<I>>
16+
constexpr I
17+
uninitialized_value_construct_n(I first,
18+
iter_difference_t<I> n); // (1) C++26
1219
}
1320
```
1421
* no-throw-forward-iterator[link no-throw-forward-iterator.md]
@@ -106,3 +113,5 @@ int main()
106113
107114
## 参照
108115
- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf)
116+
- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html)
117+
- C++26から`constexpr`がついた

0 commit comments

Comments
 (0)