Skip to content

Commit 7beb045

Browse files
Eisenwavetkoeppe
authored andcommitted
P2976R1 Freestanding Library: algorithm, numeric, and random
1 parent 7221de8 commit 7beb045

File tree

6 files changed

+369
-268
lines changed

6 files changed

+369
-268
lines changed

Diff for: source/algorithms.tex

+138-137
Large diffs are not rendered by default.

Diff for: source/exec.tex

+3-2
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,9 @@
400400
\begin{codeblock}
401401
namespace std {
402402
// \ref{execpol.type}, execution policy type trait
403-
template<class T> struct is_execution_policy;
404-
template<class T> constexpr bool @\libglobal{is_execution_policy_v}@ = is_execution_policy<T>::value;
403+
template<class T> struct is_execution_policy; // freestanding
404+
template<class T> constexpr bool @\libglobal{is_execution_policy_v}@ = // freestanding
405+
is_execution_policy<T>::value;
405406
}
406407

407408
namespace std::execution {

Diff for: source/lib-intro.tex

+5-2
Original file line numberDiff line numberDiff line change
@@ -1002,8 +1002,9 @@
10021002
\indextext{entity!freestanding item}%
10031003
\indextext{deduction guide!freestanding item}%
10041004
\indextext{\idxgram{typedef-name}!freestanding item}%
1005-
An entity, deduction guide, or \grammarterm{typedef-name} is
1006-
a freestanding item if it is:
1005+
An entity, deduction guide, or \grammarterm{typedef-name}
1006+
is a freestanding item if its introducing declaration is not followed by
1007+
a comment that includes \textit{hosted}, and is:
10071008
\begin{itemize}
10081009
\item introduced by a declaration that is a freestanding item,
10091010
\item a member of a freestanding item other than a namespace,
@@ -1601,10 +1602,12 @@
16011602
\ref{iterators} & Iterators library & \tcode{<iterator>} \\ \rowsep
16021603
\ref{ranges} & Ranges library & \tcode{<ranges>} \\ \rowsep
16031604
\ref{algorithms} & Algorithms library & \tcode{<algorithm>}, \tcode{<numeric>} \\ \rowsep
1605+
\ref{execpol} & Execution policies & \tcode{<execpol>} \\ \rowsep
16041606
\ref{string.view} & String view classes & \tcode{<string_view>} \\ \rowsep
16051607
\ref{string.classes} & String classes & \tcode{<string>} \\ \rowsep
16061608
\ref{c.strings} & Null-terminated sequence utilities & \tcode{<cstring>}, \tcode{<cwchar>} \\ \rowsep
16071609
\ref{charconv} & Primitive numeric conversions & \tcode{<charconv>} \\ \rowsep
1610+
\ref{rand} & Random number generation & \tcode{<random>} \\ \rowsep
16081611
\ref{c.math} & Mathematical functions for floating-point types & \tcode{<cmath>} \\ \rowsep
16091612
\ref{atomics} & Atomics & \tcode{<atomic>} \\ \rowsep
16101613
\end{libsumtab}

Diff for: source/memory.tex

+33-24
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,17 @@
194194
constexpr void uninitialized_default_construct(NoThrowForwardIterator first, // freestanding
195195
NoThrowForwardIterator last);
196196
template<class ExecutionPolicy, class NoThrowForwardIterator>
197-
void uninitialized_default_construct(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
198-
NoThrowForwardIterator first,
197+
void uninitialized_default_construct(ExecutionPolicy&& exec, // freestanding-deleted,
198+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
199199
NoThrowForwardIterator last);
200200
template<class NoThrowForwardIterator, class Size>
201201
constexpr NoThrowForwardIterator
202202
uninitialized_default_construct_n(NoThrowForwardIterator first, Size n); // freestanding
203203
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size>
204204
NoThrowForwardIterator
205-
uninitialized_default_construct_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
206-
NoThrowForwardIterator first, Size n);
205+
uninitialized_default_construct_n(ExecutionPolicy&& exec, // freestanding-deleted,
206+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
207+
Size n);
207208

208209
namespace ranges {
209210
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S>
@@ -223,16 +224,17 @@
223224
constexpr void uninitialized_value_construct(NoThrowForwardIterator first, // freestanding
224225
NoThrowForwardIterator last);
225226
template<class ExecutionPolicy, class NoThrowForwardIterator>
226-
void uninitialized_value_construct(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
227-
NoThrowForwardIterator first,
227+
void uninitialized_value_construct(ExecutionPolicy&& exec, // freestanding-deleted,
228+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
228229
NoThrowForwardIterator last);
229230
template<class NoThrowForwardIterator, class Size>
230231
constexpr NoThrowForwardIterator
231232
uninitialized_value_construct_n(NoThrowForwardIterator first, Size n); // freestanding
232233
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size>
233234
NoThrowForwardIterator
234-
uninitialized_value_construct_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
235-
NoThrowForwardIterator first, Size n);
235+
uninitialized_value_construct_n(ExecutionPolicy&& exec, // freestanding-deleted,
236+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
237+
Size n);
236238

237239
namespace ranges {
238240
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S>
@@ -253,17 +255,19 @@
253255
InputIterator last,
254256
NoThrowForwardIterator result);
255257
template<class ExecutionPolicy, class ForwardIterator, class NoThrowForwardIterator>
256-
NoThrowForwardIterator uninitialized_copy(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
257-
ForwardIterator first, ForwardIterator last,
258+
NoThrowForwardIterator uninitialized_copy(ExecutionPolicy&& exec, // freestanding-deleted,
259+
ForwardIterator first, // see \ref{algorithms.parallel.overloads}
260+
ForwardIterator last,
258261
NoThrowForwardIterator result);
259262
template<class InputIterator, class Size, class NoThrowForwardIterator>
260263
constexpr NoThrowForwardIterator uninitialized_copy_n(InputIterator first, // freestanding
261264
Size n,
262265
NoThrowForwardIterator result);
263266
template<class ExecutionPolicy, class ForwardIterator, class Size,
264267
class NoThrowForwardIterator>
265-
NoThrowForwardIterator uninitialized_copy_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
266-
ForwardIterator first, Size n,
268+
NoThrowForwardIterator uninitialized_copy_n(ExecutionPolicy&& exec, // freestanding-deleted,
269+
ForwardIterator first, // see \ref{algorithms.parallel.overloads}
270+
Size n,
267271
NoThrowForwardIterator result);
268272

269273
namespace ranges {
@@ -293,8 +297,9 @@
293297
InputIterator last,
294298
NoThrowForwardIterator result);
295299
template<class ExecutionPolicy, class ForwardIterator, class NoThrowForwardIterator>
296-
NoThrowForwardIterator uninitialized_move(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
297-
ForwardIterator first, ForwardIterator last,
300+
NoThrowForwardIterator uninitialized_move(ExecutionPolicy&& exec, // freestanding-deleted,
301+
ForwardIterator first, // see \ref{algorithms.parallel.overloads}
302+
ForwardIterator last,
298303
NoThrowForwardIterator result);
299304
template<class InputIterator, class Size, class NoThrowForwardIterator>
300305
constexpr pair<InputIterator, NoThrowForwardIterator>
@@ -303,8 +308,9 @@
303308
template<class ExecutionPolicy, class ForwardIterator, class Size,
304309
class NoThrowForwardIterator>
305310
pair<ForwardIterator, NoThrowForwardIterator>
306-
uninitialized_move_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
307-
ForwardIterator first, Size n, NoThrowForwardIterator result);
311+
uninitialized_move_n(ExecutionPolicy&& exec, // freestanding-deleted,
312+
ForwardIterator first, Size n, // see \ref{algorithms.parallel.overloads}
313+
NoThrowForwardIterator result);
308314

309315
namespace ranges {
310316
template<class I, class O>
@@ -333,16 +339,18 @@
333339
constexpr void uninitialized_fill(NoThrowForwardIterator first, // freestanding
334340
NoThrowForwardIterator last, const T& x);
335341
template<class ExecutionPolicy, class NoThrowForwardIterator, class T>
336-
void uninitialized_fill(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
337-
NoThrowForwardIterator first, NoThrowForwardIterator last,
342+
void uninitialized_fill(ExecutionPolicy&& exec, // freestanding-deleted,
343+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
344+
NoThrowForwardIterator last,
338345
const T& x);
339346
template<class NoThrowForwardIterator, class Size, class T>
340347
constexpr NoThrowForwardIterator
341348
uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x); // freestanding
342349
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size, class T>
343350
NoThrowForwardIterator
344-
uninitialized_fill_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
345-
NoThrowForwardIterator first, Size n, const T& x);
351+
uninitialized_fill_n(ExecutionPolicy&& exec, // freestanding-deleted,
352+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
353+
Size n, const T& x);
346354

347355
namespace ranges {
348356
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T>
@@ -374,14 +382,15 @@
374382
constexpr void destroy(NoThrowForwardIterator first, // freestanding
375383
NoThrowForwardIterator last);
376384
template<class ExecutionPolicy, class NoThrowForwardIterator>
377-
void destroy(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
378-
NoThrowForwardIterator first, NoThrowForwardIterator last);
385+
void destroy(ExecutionPolicy&& exec, // freestanding-deleted,
386+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
387+
NoThrowForwardIterator last);
379388
template<class NoThrowForwardIterator, class Size>
380389
constexpr NoThrowForwardIterator destroy_n(NoThrowForwardIterator first, // freestanding
381390
Size n);
382391
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size>
383-
NoThrowForwardIterator destroy_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
384-
NoThrowForwardIterator first, Size n);
392+
NoThrowForwardIterator destroy_n(ExecutionPolicy&& exec, // freestanding-deleted,
393+
NoThrowForwardIterator first, Size n); // see \ref{algorithms.parallel.overloads}
385394

386395
namespace ranges {
387396
template<@\libconcept{destructible}@ T>

0 commit comments

Comments
 (0)