Skip to content

Commit 392fc1e

Browse files
committed
P3508R0 Wording for "constexpr for specialized memory algorithms"
1 parent 219b959 commit 392fc1e

File tree

3 files changed

+55
-48
lines changed

3 files changed

+55
-48
lines changed

source/algorithms.tex

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11346,7 +11346,8 @@
1134611346
\indexlibraryglobal{uninitialized_value_construct}%
1134711347
\begin{itemdecl}
1134811348
template<class NoThrowForwardIterator>
11349-
void uninitialized_value_construct(NoThrowForwardIterator first, NoThrowForwardIterator last);
11349+
constexpr void uninitialized_value_construct(NoThrowForwardIterator first,
11350+
NoThrowForwardIterator last);
1135011351
\end{itemdecl}
1135111352

1135211353
\begin{itemdescr}
@@ -11365,10 +11366,10 @@
1136511366
namespace ranges {
1136611367
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S>
1136711368
requires @\libconcept{default_initializable}@<iter_value_t<I>>
11368-
I uninitialized_value_construct(I first, S last);
11369+
constexpr I uninitialized_value_construct(I first, S last);
1136911370
template<@\exposconcept{nothrow-forward-range}@ R>
1137011371
requires @\libconcept{default_initializable}@<range_value_t<R>>
11371-
borrowed_iterator_t<R> uninitialized_value_construct(R&& r);
11372+
constexpr borrowed_iterator_t<R> uninitialized_value_construct(R&& r);
1137211373
}
1137311374
\end{itemdecl}
1137411375

@@ -11386,7 +11387,8 @@
1138611387
\indexlibraryglobal{uninitialized_value_construct_n}%
1138711388
\begin{itemdecl}
1138811389
template<class NoThrowForwardIterator, class Size>
11389-
NoThrowForwardIterator uninitialized_value_construct_n(NoThrowForwardIterator first, Size n);
11390+
constexpr NoThrowForwardIterator
11391+
uninitialized_value_construct_n(NoThrowForwardIterator first, Size n);
1139011392
\end{itemdecl}
1139111393

1139211394
\begin{itemdescr}
@@ -11406,7 +11408,7 @@
1140611408
namespace ranges {
1140711409
template<@\exposconcept{nothrow-forward-iterator}@ I>
1140811410
requires @\libconcept{default_initializable}@<iter_value_t<I>>
11409-
I uninitialized_value_construct_n(I first, iter_difference_t<I> n);
11411+
constexpr I uninitialized_value_construct_n(I first, iter_difference_t<I> n);
1141011412
}
1141111413
\end{itemdecl}
1141211414

@@ -11425,8 +11427,8 @@
1142511427
\indexlibraryglobal{uninitialized_copy}%
1142611428
\begin{itemdecl}
1142711429
template<class InputIterator, class NoThrowForwardIterator>
11428-
NoThrowForwardIterator uninitialized_copy(InputIterator first, InputIterator last,
11429-
NoThrowForwardIterator result);
11430+
constexpr NoThrowForwardIterator uninitialized_copy(InputIterator first, InputIterator last,
11431+
NoThrowForwardIterator result);
1143011432
\end{itemdecl}
1143111433

1143211434
\begin{itemdescr}
@@ -11454,11 +11456,11 @@
1145411456
template<@\libconcept{input_iterator}@ I, @\libconcept{sentinel_for}@<I> S1,
1145511457
@\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S2>
1145611458
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_reference_t<I>>
11457-
uninitialized_copy_result<I, O>
11459+
constexpr uninitialized_copy_result<I, O>
1145811460
uninitialized_copy(I ifirst, S1 ilast, O ofirst, S2 olast);
1145911461
template<@\libconcept{input_range}@ IR, @\exposconcept{nothrow-forward-range}@ OR>
1146011462
requires @\libconcept{constructible_from}@<range_value_t<OR>, range_reference_t<IR>>
11461-
uninitialized_copy_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
11463+
constexpr uninitialized_copy_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
1146211464
uninitialized_copy(IR&& in_range, OR&& out_range);
1146311465
}
1146411466
\end{itemdecl}
@@ -11481,8 +11483,8 @@
1148111483
\indexlibraryglobal{uninitialized_copy_n}%
1148211484
\begin{itemdecl}
1148311485
template<class InputIterator, class Size, class NoThrowForwardIterator>
11484-
NoThrowForwardIterator uninitialized_copy_n(InputIterator first, Size n,
11485-
NoThrowForwardIterator result);
11486+
constexpr NoThrowForwardIterator uninitialized_copy_n(InputIterator first, Size n,
11487+
NoThrowForwardIterator result);
1148611488
\end{itemdecl}
1148711489

1148811490
\begin{itemdescr}
@@ -11509,7 +11511,7 @@
1150911511
namespace ranges {
1151011512
template<@\libconcept{input_iterator}@ I, @\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S>
1151111513
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_reference_t<I>>
11512-
uninitialized_copy_n_result<I, O>
11514+
constexpr uninitialized_copy_n_result<I, O>
1151311515
uninitialized_copy_n(I ifirst, iter_difference_t<I> n, O ofirst, S olast);
1151411516
}
1151511517
\end{itemdecl}
@@ -11535,8 +11537,8 @@
1153511537
\indexlibraryglobal{uninitialized_move}%
1153611538
\begin{itemdecl}
1153711539
template<class InputIterator, class NoThrowForwardIterator>
11538-
NoThrowForwardIterator uninitialized_move(InputIterator first, InputIterator last,
11539-
NoThrowForwardIterator result);
11540+
constexpr NoThrowForwardIterator uninitialized_move(InputIterator first, InputIterator last,
11541+
NoThrowForwardIterator result);
1154011542
\end{itemdecl}
1154111543

1154211544
\begin{itemdescr}
@@ -11561,11 +11563,11 @@
1156111563
template<@\libconcept{input_iterator}@ I, @\libconcept{sentinel_for}@<I> S1,
1156211564
@\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S2>
1156311565
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_rvalue_reference_t<I>>
11564-
uninitialized_move_result<I, O>
11566+
constexpr uninitialized_move_result<I, O>
1156511567
uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast);
1156611568
template<@\libconcept{input_range}@ IR, @\exposconcept{nothrow-forward-range}@ OR>
1156711569
requires @\libconcept{constructible_from}@<range_value_t<OR>, range_rvalue_reference_t<IR>>
11568-
uninitialized_move_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
11570+
constexpr uninitialized_move_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
1156911571
uninitialized_move(IR&& in_range, OR&& out_range);
1157011572
}
1157111573
\end{itemdecl}
@@ -11595,7 +11597,7 @@
1159511597
\indexlibraryglobal{uninitialized_move_n}%
1159611598
\begin{itemdecl}
1159711599
template<class InputIterator, class Size, class NoThrowForwardIterator>
11598-
pair<InputIterator, NoThrowForwardIterator>
11600+
constexpr pair<InputIterator, NoThrowForwardIterator>
1159911601
uninitialized_move_n(InputIterator first, Size n, NoThrowForwardIterator result);
1160011602
\end{itemdecl}
1160111603

@@ -11620,7 +11622,7 @@
1162011622
namespace ranges {
1162111623
template<@\libconcept{input_iterator}@ I, @\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S>
1162211624
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_rvalue_reference_t<I>>
11623-
uninitialized_move_n_result<I, O>
11625+
constexpr uninitialized_move_n_result<I, O>
1162411626
uninitialized_move_n(I ifirst, iter_difference_t<I> n, O ofirst, S olast);
1162511627
}
1162611628
\end{itemdecl}
@@ -11652,7 +11654,8 @@
1165211654
\indexlibraryglobal{uninitialized_fill}%
1165311655
\begin{itemdecl}
1165411656
template<class NoThrowForwardIterator, class T>
11655-
void uninitialized_fill(NoThrowForwardIterator first, NoThrowForwardIterator last, const T& x);
11657+
constexpr void uninitialized_fill(NoThrowForwardIterator first,
11658+
NoThrowForwardIterator last, const T& x);
1165611659
\end{itemdecl}
1165711660

1165811661
\begin{itemdescr}
@@ -11671,10 +11674,10 @@
1167111674
namespace ranges {
1167211675
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T>
1167311676
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
11674-
I uninitialized_fill(I first, S last, const T& x);
11677+
constexpr I uninitialized_fill(I first, S last, const T& x);
1167511678
template<@\exposconcept{nothrow-forward-range}@ R, class T>
1167611679
requires @\libconcept{constructible_from}@<range_value_t<R>, const T&>
11677-
borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x);
11680+
constexpr borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x);
1167811681
}
1167911682
\end{itemdecl}
1168011683

@@ -11692,7 +11695,8 @@
1169211695
\indexlibraryglobal{uninitialized_fill_n}%
1169311696
\begin{itemdecl}
1169411697
template<class NoThrowForwardIterator, class Size, class T>
11695-
NoThrowForwardIterator uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x);
11698+
constexpr NoThrowForwardIterator
11699+
uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x);
1169611700
\end{itemdecl}
1169711701

1169811702
\begin{itemdescr}
@@ -11712,7 +11716,7 @@
1171211716
namespace ranges {
1171311717
template<@\exposconcept{nothrow-forward-iterator}@ I, class T>
1171411718
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
11715-
I uninitialized_fill_n(I first, iter_difference_t<I> n, const T& x);
11719+
constexpr I uninitialized_fill_n(I first, iter_difference_t<I> n, const T& x);
1171611720
}
1171711721
\end{itemdecl}
1171811722

source/memory.tex

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,14 @@
213213
}
214214

215215
template<class NoThrowForwardIterator>
216-
void uninitialized_value_construct(NoThrowForwardIterator first, // freestanding
217-
NoThrowForwardIterator last);
216+
constexpr void uninitialized_value_construct(NoThrowForwardIterator first, // freestanding
217+
NoThrowForwardIterator last);
218218
template<class ExecutionPolicy, class NoThrowForwardIterator>
219219
void uninitialized_value_construct(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
220220
NoThrowForwardIterator first,
221221
NoThrowForwardIterator last);
222222
template<class NoThrowForwardIterator, class Size>
223-
NoThrowForwardIterator
223+
constexpr NoThrowForwardIterator
224224
uninitialized_value_construct_n(NoThrowForwardIterator first, Size n); // freestanding
225225
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size>
226226
NoThrowForwardIterator
@@ -230,27 +230,29 @@
230230
namespace ranges {
231231
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S>
232232
requires @\libconcept{default_initializable}@<iter_value_t<I>>
233-
I uninitialized_value_construct(I first, S last); // freestanding
233+
constexpr I uninitialized_value_construct(I first, S last); // freestanding
234234
template<@\exposconcept{nothrow-forward-range}@ R>
235235
requires @\libconcept{default_initializable}@<range_value_t<R>>
236-
borrowed_iterator_t<R> uninitialized_value_construct(R&& r); // freestanding
236+
constexpr borrowed_iterator_t<R> uninitialized_value_construct(R&& r); // freestanding
237237

238238
template<@\exposconcept{nothrow-forward-iterator}@ I>
239239
requires @\libconcept{default_initializable}@<iter_value_t<I>>
240-
I uninitialized_value_construct_n(I first, iter_difference_t<I> n); // freestanding
240+
constexpr I uninitialized_value_construct_n(I first, // freestanding
241+
iter_difference_t<I> n);
241242
}
242243

243244
template<class InputIterator, class NoThrowForwardIterator>
244-
NoThrowForwardIterator uninitialized_copy(InputIterator first, // freestanding
245-
InputIterator last,
246-
NoThrowForwardIterator result);
245+
constexpr NoThrowForwardIterator uninitialized_copy(InputIterator first, // freestanding
246+
InputIterator last,
247+
NoThrowForwardIterator result);
247248
template<class ExecutionPolicy, class ForwardIterator, class NoThrowForwardIterator>
248249
NoThrowForwardIterator uninitialized_copy(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
249250
ForwardIterator first, ForwardIterator last,
250251
NoThrowForwardIterator result);
251252
template<class InputIterator, class Size, class NoThrowForwardIterator>
252-
NoThrowForwardIterator uninitialized_copy_n(InputIterator first, Size n, // freestanding
253-
NoThrowForwardIterator result);
253+
constexpr NoThrowForwardIterator uninitialized_copy_n(InputIterator first, // freestanding
254+
Size n,
255+
NoThrowForwardIterator result);
254256
template<class ExecutionPolicy, class ForwardIterator, class Size,
255257
class NoThrowForwardIterator>
256258
NoThrowForwardIterator uninitialized_copy_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
@@ -263,32 +265,32 @@
263265
template<@\libconcept{input_iterator}@ I, @\libconcept{sentinel_for}@<I> S1,
264266
@\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S2>
265267
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_reference_t<I>>
266-
uninitialized_copy_result<I, O>
268+
constexpr uninitialized_copy_result<I, O>
267269
uninitialized_copy(I ifirst, S1 ilast, O ofirst, S2 olast); // freestanding
268270
template<@\libconcept{input_range}@ IR, @\exposconcept{nothrow-forward-range}@ OR>
269271
requires @\libconcept{constructible_from}@<range_value_t<OR>, range_reference_t<IR>>
270-
uninitialized_copy_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
272+
constexpr uninitialized_copy_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
271273
uninitialized_copy(IR&& in_range, OR&& out_range); // freestanding
272274

273275
template<class I, class O>
274276
using uninitialized_copy_n_result = in_out_result<I, O>; // freestanding
275277
template<@\libconcept{input_iterator}@ I, @\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S>
276278
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_reference_t<I>>
277-
uninitialized_copy_n_result<I, O>
279+
constexpr uninitialized_copy_n_result<I, O>
278280
uninitialized_copy_n(I ifirst, iter_difference_t<I> n, // freestanding
279281
O ofirst, S olast);
280282
}
281283

282284
template<class InputIterator, class NoThrowForwardIterator>
283-
NoThrowForwardIterator uninitialized_move(InputIterator first, // freestanding
285+
constexpr NoThrowForwardIterator uninitialized_move(InputIterator first, // freestanding
284286
InputIterator last,
285287
NoThrowForwardIterator result);
286288
template<class ExecutionPolicy, class ForwardIterator, class NoThrowForwardIterator>
287289
NoThrowForwardIterator uninitialized_move(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
288290
ForwardIterator first, ForwardIterator last,
289291
NoThrowForwardIterator result);
290292
template<class InputIterator, class Size, class NoThrowForwardIterator>
291-
pair<InputIterator, NoThrowForwardIterator>
293+
constexpr pair<InputIterator, NoThrowForwardIterator>
292294
uninitialized_move_n(InputIterator first, Size n, // freestanding
293295
NoThrowForwardIterator result);
294296
template<class ExecutionPolicy, class ForwardIterator, class Size,
@@ -303,32 +305,32 @@
303305
template<@\libconcept{input_iterator}@ I, @\libconcept{sentinel_for}@<I> S1,
304306
@\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S2>
305307
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_rvalue_reference_t<I>>
306-
uninitialized_move_result<I, O>
308+
constexpr uninitialized_move_result<I, O>
307309
uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast); // freestanding
308310
template<@\libconcept{input_range}@ IR, @\exposconcept{nothrow-forward-range}@ OR>
309311
requires @\libconcept{constructible_from}@<range_value_t<OR>, range_rvalue_reference_t<IR>>
310-
uninitialized_move_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
312+
constexpr uninitialized_move_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
311313
uninitialized_move(IR&& in_range, OR&& out_range); // freestanding
312314

313315
template<class I, class O>
314316
using uninitialized_move_n_result = in_out_result<I, O>; // freestanding
315317
template<@\libconcept{input_iterator}@ I,
316318
@\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S>
317319
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_rvalue_reference_t<I>>
318-
uninitialized_move_n_result<I, O>
320+
constexpr uninitialized_move_n_result<I, O>
319321
uninitialized_move_n(I ifirst, iter_difference_t<I> n, // freestanding
320322
O ofirst, S olast);
321323
}
322324

323325
template<class NoThrowForwardIterator, class T>
324-
void uninitialized_fill(NoThrowForwardIterator first, // freestanding
326+
constexpr void uninitialized_fill(NoThrowForwardIterator first, // freestanding
325327
NoThrowForwardIterator last, const T& x);
326328
template<class ExecutionPolicy, class NoThrowForwardIterator, class T>
327329
void uninitialized_fill(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
328330
NoThrowForwardIterator first, NoThrowForwardIterator last,
329331
const T& x);
330332
template<class NoThrowForwardIterator, class Size, class T>
331-
NoThrowForwardIterator
333+
constexpr NoThrowForwardIterator
332334
uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x); // freestanding
333335
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size, class T>
334336
NoThrowForwardIterator
@@ -338,14 +340,15 @@
338340
namespace ranges {
339341
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T>
340342
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
341-
I uninitialized_fill(I first, S last, const T& x); // freestanding
343+
constexpr I uninitialized_fill(I first, S last, const T& x); // freestanding
342344
template<@\exposconcept{nothrow-forward-range}@ R, class T>
343345
requires @\libconcept{constructible_from}@<range_value_t<R>, const T&>
344-
borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x); // freestanding
346+
constexpr borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x); // freestanding
345347

346348
template<@\exposconcept{nothrow-forward-iterator}@ I, class T>
347349
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
348-
I uninitialized_fill_n(I first, iter_difference_t<I> n, const T& x); // freestanding
350+
constexpr I uninitialized_fill_n(I first, // freestanding
351+
iter_difference_t<I> n, const T& x);
349352
}
350353

351354
// \ref{specialized.construct}, \tcode{construct_at}

source/support.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@
758758
#define @\defnlibxname{cpp_lib_ranges_zip}@ 202110L
759759
// freestanding, also in \libheader{ranges}, \libheader{tuple}, \libheader{utility}
760760
#define @\defnlibxname{cpp_lib_ratio}@ 202306L // also in \libheader{ratio}
761-
#define @\defnlibxname{cpp_lib_raw_memory_algorithms}@ 201606L // also in \libheader{memory}
761+
#define @\defnlibxname{cpp_lib_raw_memory_algorithms}@ 202411L // also in \libheader{memory}
762762
#define @\defnlibxname{cpp_lib_rcu}@ 202306L // also in \libheader{rcu}
763763
#define @\defnlibxname{cpp_lib_reference_from_temporary}@ 202202L // freestanding, also in \libheader{type_traits}
764764
#define @\defnlibxname{cpp_lib_reference_wrapper}@ 202403L // freestanding, also in \libheader{functional}

0 commit comments

Comments
 (0)