Skip to content

Commit 3123fa0

Browse files
jensmaurertkoeppe
authored andcommitted
P3508R0 Wording for "constexpr for specialized memory algorithms"
1 parent fdc4de0 commit 3123fa0

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
@@ -11334,7 +11334,8 @@
1133411334
\indexlibraryglobal{uninitialized_value_construct}%
1133511335
\begin{itemdecl}
1133611336
template<class NoThrowForwardIterator>
11337-
void uninitialized_value_construct(NoThrowForwardIterator first, NoThrowForwardIterator last);
11337+
constexpr void uninitialized_value_construct(NoThrowForwardIterator first,
11338+
NoThrowForwardIterator last);
1133811339
\end{itemdecl}
1133911340

1134011341
\begin{itemdescr}
@@ -11353,10 +11354,10 @@
1135311354
namespace ranges {
1135411355
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S>
1135511356
requires @\libconcept{default_initializable}@<iter_value_t<I>>
11356-
I uninitialized_value_construct(I first, S last);
11357+
constexpr I uninitialized_value_construct(I first, S last);
1135711358
template<@\exposconcept{nothrow-forward-range}@ R>
1135811359
requires @\libconcept{default_initializable}@<range_value_t<R>>
11359-
borrowed_iterator_t<R> uninitialized_value_construct(R&& r);
11360+
constexpr borrowed_iterator_t<R> uninitialized_value_construct(R&& r);
1136011361
}
1136111362
\end{itemdecl}
1136211363

@@ -11374,7 +11375,8 @@
1137411375
\indexlibraryglobal{uninitialized_value_construct_n}%
1137511376
\begin{itemdecl}
1137611377
template<class NoThrowForwardIterator, class Size>
11377-
NoThrowForwardIterator uninitialized_value_construct_n(NoThrowForwardIterator first, Size n);
11378+
constexpr NoThrowForwardIterator
11379+
uninitialized_value_construct_n(NoThrowForwardIterator first, Size n);
1137811380
\end{itemdecl}
1137911381

1138011382
\begin{itemdescr}
@@ -11394,7 +11396,7 @@
1139411396
namespace ranges {
1139511397
template<@\exposconcept{nothrow-forward-iterator}@ I>
1139611398
requires @\libconcept{default_initializable}@<iter_value_t<I>>
11397-
I uninitialized_value_construct_n(I first, iter_difference_t<I> n);
11399+
constexpr I uninitialized_value_construct_n(I first, iter_difference_t<I> n);
1139811400
}
1139911401
\end{itemdecl}
1140011402

@@ -11413,8 +11415,8 @@
1141311415
\indexlibraryglobal{uninitialized_copy}%
1141411416
\begin{itemdecl}
1141511417
template<class InputIterator, class NoThrowForwardIterator>
11416-
NoThrowForwardIterator uninitialized_copy(InputIterator first, InputIterator last,
11417-
NoThrowForwardIterator result);
11418+
constexpr NoThrowForwardIterator uninitialized_copy(InputIterator first, InputIterator last,
11419+
NoThrowForwardIterator result);
1141811420
\end{itemdecl}
1141911421

1142011422
\begin{itemdescr}
@@ -11442,11 +11444,11 @@
1144211444
template<@\libconcept{input_iterator}@ I, @\libconcept{sentinel_for}@<I> S1,
1144311445
@\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S2>
1144411446
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_reference_t<I>>
11445-
uninitialized_copy_result<I, O>
11447+
constexpr uninitialized_copy_result<I, O>
1144611448
uninitialized_copy(I ifirst, S1 ilast, O ofirst, S2 olast);
1144711449
template<@\libconcept{input_range}@ IR, @\exposconcept{nothrow-forward-range}@ OR>
1144811450
requires @\libconcept{constructible_from}@<range_value_t<OR>, range_reference_t<IR>>
11449-
uninitialized_copy_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
11451+
constexpr uninitialized_copy_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
1145011452
uninitialized_copy(IR&& in_range, OR&& out_range);
1145111453
}
1145211454
\end{itemdecl}
@@ -11469,8 +11471,8 @@
1146911471
\indexlibraryglobal{uninitialized_copy_n}%
1147011472
\begin{itemdecl}
1147111473
template<class InputIterator, class Size, class NoThrowForwardIterator>
11472-
NoThrowForwardIterator uninitialized_copy_n(InputIterator first, Size n,
11473-
NoThrowForwardIterator result);
11474+
constexpr NoThrowForwardIterator uninitialized_copy_n(InputIterator first, Size n,
11475+
NoThrowForwardIterator result);
1147411476
\end{itemdecl}
1147511477

1147611478
\begin{itemdescr}
@@ -11497,7 +11499,7 @@
1149711499
namespace ranges {
1149811500
template<@\libconcept{input_iterator}@ I, @\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S>
1149911501
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_reference_t<I>>
11500-
uninitialized_copy_n_result<I, O>
11502+
constexpr uninitialized_copy_n_result<I, O>
1150111503
uninitialized_copy_n(I ifirst, iter_difference_t<I> n, O ofirst, S olast);
1150211504
}
1150311505
\end{itemdecl}
@@ -11523,8 +11525,8 @@
1152311525
\indexlibraryglobal{uninitialized_move}%
1152411526
\begin{itemdecl}
1152511527
template<class InputIterator, class NoThrowForwardIterator>
11526-
NoThrowForwardIterator uninitialized_move(InputIterator first, InputIterator last,
11527-
NoThrowForwardIterator result);
11528+
constexpr NoThrowForwardIterator uninitialized_move(InputIterator first, InputIterator last,
11529+
NoThrowForwardIterator result);
1152811530
\end{itemdecl}
1152911531

1153011532
\begin{itemdescr}
@@ -11549,11 +11551,11 @@
1154911551
template<@\libconcept{input_iterator}@ I, @\libconcept{sentinel_for}@<I> S1,
1155011552
@\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S2>
1155111553
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_rvalue_reference_t<I>>
11552-
uninitialized_move_result<I, O>
11554+
constexpr uninitialized_move_result<I, O>
1155311555
uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast);
1155411556
template<@\libconcept{input_range}@ IR, @\exposconcept{nothrow-forward-range}@ OR>
1155511557
requires @\libconcept{constructible_from}@<range_value_t<OR>, range_rvalue_reference_t<IR>>
11556-
uninitialized_move_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
11558+
constexpr uninitialized_move_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
1155711559
uninitialized_move(IR&& in_range, OR&& out_range);
1155811560
}
1155911561
\end{itemdecl}
@@ -11583,7 +11585,7 @@
1158311585
\indexlibraryglobal{uninitialized_move_n}%
1158411586
\begin{itemdecl}
1158511587
template<class InputIterator, class Size, class NoThrowForwardIterator>
11586-
pair<InputIterator, NoThrowForwardIterator>
11588+
constexpr pair<InputIterator, NoThrowForwardIterator>
1158711589
uninitialized_move_n(InputIterator first, Size n, NoThrowForwardIterator result);
1158811590
\end{itemdecl}
1158911591

@@ -11608,7 +11610,7 @@
1160811610
namespace ranges {
1160911611
template<@\libconcept{input_iterator}@ I, @\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S>
1161011612
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_rvalue_reference_t<I>>
11611-
uninitialized_move_n_result<I, O>
11613+
constexpr uninitialized_move_n_result<I, O>
1161211614
uninitialized_move_n(I ifirst, iter_difference_t<I> n, O ofirst, S olast);
1161311615
}
1161411616
\end{itemdecl}
@@ -11640,7 +11642,8 @@
1164011642
\indexlibraryglobal{uninitialized_fill}%
1164111643
\begin{itemdecl}
1164211644
template<class NoThrowForwardIterator, class T>
11643-
void uninitialized_fill(NoThrowForwardIterator first, NoThrowForwardIterator last, const T& x);
11645+
constexpr void uninitialized_fill(NoThrowForwardIterator first,
11646+
NoThrowForwardIterator last, const T& x);
1164411647
\end{itemdecl}
1164511648

1164611649
\begin{itemdescr}
@@ -11659,10 +11662,10 @@
1165911662
namespace ranges {
1166011663
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T>
1166111664
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
11662-
I uninitialized_fill(I first, S last, const T& x);
11665+
constexpr I uninitialized_fill(I first, S last, const T& x);
1166311666
template<@\exposconcept{nothrow-forward-range}@ R, class T>
1166411667
requires @\libconcept{constructible_from}@<range_value_t<R>, const T&>
11665-
borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x);
11668+
constexpr borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x);
1166611669
}
1166711670
\end{itemdecl}
1166811671

@@ -11680,7 +11683,8 @@
1168011683
\indexlibraryglobal{uninitialized_fill_n}%
1168111684
\begin{itemdecl}
1168211685
template<class NoThrowForwardIterator, class Size, class T>
11683-
NoThrowForwardIterator uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x);
11686+
constexpr NoThrowForwardIterator
11687+
uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x);
1168411688
\end{itemdecl}
1168511689

1168611690
\begin{itemdescr}
@@ -11700,7 +11704,7 @@
1170011704
namespace ranges {
1170111705
template<@\exposconcept{nothrow-forward-iterator}@ I, class T>
1170211706
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
11703-
I uninitialized_fill_n(I first, iter_difference_t<I> n, const T& x);
11707+
constexpr I uninitialized_fill_n(I first, iter_difference_t<I> n, const T& x);
1170411708
}
1170511709
\end{itemdecl}
1170611710

source/memory.tex

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,14 @@
215215
}
216216

217217
template<class NoThrowForwardIterator>
218-
void uninitialized_value_construct(NoThrowForwardIterator first, // freestanding
219-
NoThrowForwardIterator last);
218+
constexpr void uninitialized_value_construct(NoThrowForwardIterator first, // freestanding
219+
NoThrowForwardIterator last);
220220
template<class ExecutionPolicy, class NoThrowForwardIterator>
221221
void uninitialized_value_construct(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
222222
NoThrowForwardIterator first,
223223
NoThrowForwardIterator last);
224224
template<class NoThrowForwardIterator, class Size>
225-
NoThrowForwardIterator
225+
constexpr NoThrowForwardIterator
226226
uninitialized_value_construct_n(NoThrowForwardIterator first, Size n); // freestanding
227227
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size>
228228
NoThrowForwardIterator
@@ -232,27 +232,29 @@
232232
namespace ranges {
233233
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S>
234234
requires @\libconcept{default_initializable}@<iter_value_t<I>>
235-
I uninitialized_value_construct(I first, S last); // freestanding
235+
constexpr I uninitialized_value_construct(I first, S last); // freestanding
236236
template<@\exposconcept{nothrow-forward-range}@ R>
237237
requires @\libconcept{default_initializable}@<range_value_t<R>>
238-
borrowed_iterator_t<R> uninitialized_value_construct(R&& r); // freestanding
238+
constexpr borrowed_iterator_t<R> uninitialized_value_construct(R&& r); // freestanding
239239

240240
template<@\exposconcept{nothrow-forward-iterator}@ I>
241241
requires @\libconcept{default_initializable}@<iter_value_t<I>>
242-
I uninitialized_value_construct_n(I first, iter_difference_t<I> n); // freestanding
242+
constexpr I uninitialized_value_construct_n(I first, // freestanding
243+
iter_difference_t<I> n);
243244
}
244245

245246
template<class InputIterator, class NoThrowForwardIterator>
246-
NoThrowForwardIterator uninitialized_copy(InputIterator first, // freestanding
247-
InputIterator last,
248-
NoThrowForwardIterator result);
247+
constexpr NoThrowForwardIterator uninitialized_copy(InputIterator first, // freestanding
248+
InputIterator last,
249+
NoThrowForwardIterator result);
249250
template<class ExecutionPolicy, class ForwardIterator, class NoThrowForwardIterator>
250251
NoThrowForwardIterator uninitialized_copy(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
251252
ForwardIterator first, ForwardIterator last,
252253
NoThrowForwardIterator result);
253254
template<class InputIterator, class Size, class NoThrowForwardIterator>
254-
NoThrowForwardIterator uninitialized_copy_n(InputIterator first, Size n, // freestanding
255-
NoThrowForwardIterator result);
255+
constexpr NoThrowForwardIterator uninitialized_copy_n(InputIterator first, // freestanding
256+
Size n,
257+
NoThrowForwardIterator result);
256258
template<class ExecutionPolicy, class ForwardIterator, class Size,
257259
class NoThrowForwardIterator>
258260
NoThrowForwardIterator uninitialized_copy_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
@@ -265,32 +267,32 @@
265267
template<@\libconcept{input_iterator}@ I, @\libconcept{sentinel_for}@<I> S1,
266268
@\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S2>
267269
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_reference_t<I>>
268-
uninitialized_copy_result<I, O>
270+
constexpr uninitialized_copy_result<I, O>
269271
uninitialized_copy(I ifirst, S1 ilast, O ofirst, S2 olast); // freestanding
270272
template<@\libconcept{input_range}@ IR, @\exposconcept{nothrow-forward-range}@ OR>
271273
requires @\libconcept{constructible_from}@<range_value_t<OR>, range_reference_t<IR>>
272-
uninitialized_copy_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
274+
constexpr uninitialized_copy_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
273275
uninitialized_copy(IR&& in_range, OR&& out_range); // freestanding
274276

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

284286
template<class InputIterator, class NoThrowForwardIterator>
285-
NoThrowForwardIterator uninitialized_move(InputIterator first, // freestanding
287+
constexpr NoThrowForwardIterator uninitialized_move(InputIterator first, // freestanding
286288
InputIterator last,
287289
NoThrowForwardIterator result);
288290
template<class ExecutionPolicy, class ForwardIterator, class NoThrowForwardIterator>
289291
NoThrowForwardIterator uninitialized_move(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
290292
ForwardIterator first, ForwardIterator last,
291293
NoThrowForwardIterator result);
292294
template<class InputIterator, class Size, class NoThrowForwardIterator>
293-
pair<InputIterator, NoThrowForwardIterator>
295+
constexpr pair<InputIterator, NoThrowForwardIterator>
294296
uninitialized_move_n(InputIterator first, Size n, // freestanding
295297
NoThrowForwardIterator result);
296298
template<class ExecutionPolicy, class ForwardIterator, class Size,
@@ -305,32 +307,32 @@
305307
template<@\libconcept{input_iterator}@ I, @\libconcept{sentinel_for}@<I> S1,
306308
@\exposconcept{nothrow-forward-iterator}@ O, @\exposconcept{nothrow-sentinel-for}@<O> S2>
307309
requires @\libconcept{constructible_from}@<iter_value_t<O>, iter_rvalue_reference_t<I>>
308-
uninitialized_move_result<I, O>
310+
constexpr uninitialized_move_result<I, O>
309311
uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast); // freestanding
310312
template<@\libconcept{input_range}@ IR, @\exposconcept{nothrow-forward-range}@ OR>
311313
requires @\libconcept{constructible_from}@<range_value_t<OR>, range_rvalue_reference_t<IR>>
312-
uninitialized_move_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
314+
constexpr uninitialized_move_result<borrowed_iterator_t<IR>, borrowed_iterator_t<OR>>
313315
uninitialized_move(IR&& in_range, OR&& out_range); // freestanding
314316

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

325327
template<class NoThrowForwardIterator, class T>
326-
void uninitialized_fill(NoThrowForwardIterator first, // freestanding
328+
constexpr void uninitialized_fill(NoThrowForwardIterator first, // freestanding
327329
NoThrowForwardIterator last, const T& x);
328330
template<class ExecutionPolicy, class NoThrowForwardIterator, class T>
329331
void uninitialized_fill(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
330332
NoThrowForwardIterator first, NoThrowForwardIterator last,
331333
const T& x);
332334
template<class NoThrowForwardIterator, class Size, class T>
333-
NoThrowForwardIterator
335+
constexpr NoThrowForwardIterator
334336
uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x); // freestanding
335337
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size, class T>
336338
NoThrowForwardIterator
@@ -340,14 +342,15 @@
340342
namespace ranges {
341343
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T>
342344
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
343-
I uninitialized_fill(I first, S last, const T& x); // freestanding
345+
constexpr I uninitialized_fill(I first, S last, const T& x); // freestanding
344346
template<@\exposconcept{nothrow-forward-range}@ R, class T>
345347
requires @\libconcept{constructible_from}@<range_value_t<R>, const T&>
346-
borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x); // freestanding
348+
constexpr borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x); // freestanding
347349

348350
template<@\exposconcept{nothrow-forward-iterator}@ I, class T>
349351
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
350-
I uninitialized_fill_n(I first, iter_difference_t<I> n, const T& x); // freestanding
352+
constexpr I uninitialized_fill_n(I first, // freestanding
353+
iter_difference_t<I> n, const T& x);
351354
}
352355

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

source/support.tex

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

0 commit comments

Comments
 (0)