Skip to content

Commit 8ba7392

Browse files
committed
P2976R1 Freestanding Library: algorithm, numeric, and random
1 parent 805aac8 commit 8ba7392

File tree

6 files changed

+364
-263
lines changed

6 files changed

+364
-263
lines changed

source/algorithms.tex

Lines changed: 134 additions & 132 deletions
Large diffs are not rendered by default.

source/exec.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,9 @@
393393
\begin{codeblock}
394394
namespace std {
395395
// \ref{execpol.type}, execution policy type trait
396-
template<class T> struct is_execution_policy;
397-
template<class T> constexpr bool @\libglobal{is_execution_policy_v}@ = is_execution_policy<T>::value;
396+
template<class T> struct is_execution_policy; // freestanding
397+
template<class T> constexpr bool @\libglobal{is_execution_policy_v}@ = // freestanding
398+
is_execution_policy<T>::value;
398399
}
399400

400401
namespace std::execution {

source/lib-intro.tex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,8 +992,9 @@
992992
\indextext{entity!freestanding item}%
993993
\indextext{deduction guide!freestanding item}%
994994
\indextext{\idxgram{typedef-name}!freestanding item}%
995-
An entity, deduction guide, or \grammarterm{typedef-name} is
996-
a freestanding item if it is:
995+
An entity, deduction guide, or \grammarterm{typedef-name}
996+
is a freestanding item if its introducing declaration is not followed by
997+
a comment that includes \textit{hosted}, and is:
997998
\begin{itemize}
998999
\item introduced by a declaration that is a freestanding item,
9991000
\item a member of a freestanding item other than a namespace,
@@ -1587,10 +1588,12 @@
15871588
\ref{iterators} & Iterators library & \tcode{<iterator>} \\ \rowsep
15881589
\ref{ranges} & Ranges library & \tcode{<ranges>} \\ \rowsep
15891590
\ref{algorithms} & Algorithms library & \tcode{<algorithm>}, \tcode{<numeric>} \\ \rowsep
1591+
\ref{execpol} & Execution policies & \tcode{<execpol>} \\ \rowsep
15901592
\ref{string.view} & String view classes & \tcode{<string_view>} \\ \rowsep
15911593
\ref{string.classes} & String classes & \tcode{<string>} \\ \rowsep
15921594
\ref{c.strings} & Null-terminated sequence utilities & \tcode{<cstring>}, \tcode{<cwchar>} \\ \rowsep
15931595
\ref{charconv} & Primitive numeric conversions & \tcode{<charconv>} \\ \rowsep
1596+
\ref{rand} & Random number generation & \tcode{<random>} \\ \rowsep
15941597
\ref{c.math} & Mathematical functions for floating-point types & \tcode{<cmath>} \\ \rowsep
15951598
\ref{atomics} & Atomics & \tcode{<atomic>} \\ \rowsep
15961599
\end{libsumtab}

source/memory.tex

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,17 @@
190190
constexpr void uninitialized_default_construct(NoThrowForwardIterator first, // freestanding
191191
NoThrowForwardIterator last);
192192
template<class ExecutionPolicy, class NoThrowForwardIterator>
193-
void uninitialized_default_construct(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
194-
NoThrowForwardIterator first,
193+
void uninitialized_default_construct(ExecutionPolicy&& exec, // freestanding-deleted,
194+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
195195
NoThrowForwardIterator last);
196196
template<class NoThrowForwardIterator, class Size>
197197
constexpr NoThrowForwardIterator
198198
uninitialized_default_construct_n(NoThrowForwardIterator first, Size n); // freestanding
199199
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size>
200200
NoThrowForwardIterator
201-
uninitialized_default_construct_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
202-
NoThrowForwardIterator first, Size n);
201+
uninitialized_default_construct_n(ExecutionPolicy&& exec, // freestanding-deleted,
202+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
203+
Size n);
203204

204205
namespace ranges {
205206
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S>
@@ -219,16 +220,17 @@
219220
constexpr void uninitialized_value_construct(NoThrowForwardIterator first, // freestanding
220221
NoThrowForwardIterator last);
221222
template<class ExecutionPolicy, class NoThrowForwardIterator>
222-
void uninitialized_value_construct(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
223-
NoThrowForwardIterator first,
223+
void uninitialized_value_construct(ExecutionPolicy&& exec, // freestanding-deleted,
224+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
224225
NoThrowForwardIterator last);
225226
template<class NoThrowForwardIterator, class Size>
226227
constexpr NoThrowForwardIterator
227228
uninitialized_value_construct_n(NoThrowForwardIterator first, Size n); // freestanding
228229
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size>
229230
NoThrowForwardIterator
230-
uninitialized_value_construct_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
231-
NoThrowForwardIterator first, Size n);
231+
uninitialized_value_construct_n(ExecutionPolicy&& exec, // freestanding-deleted,
232+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
233+
Size n);
232234

233235
namespace ranges {
234236
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S>
@@ -249,17 +251,19 @@
249251
InputIterator last,
250252
NoThrowForwardIterator result);
251253
template<class ExecutionPolicy, class ForwardIterator, class NoThrowForwardIterator>
252-
NoThrowForwardIterator uninitialized_copy(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
253-
ForwardIterator first, ForwardIterator last,
254+
NoThrowForwardIterator uninitialized_copy(ExecutionPolicy&& exec, // freestanding-deleted,
255+
ForwardIterator first, // see \ref{algorithms.parallel.overloads}
256+
ForwardIterator last,
254257
NoThrowForwardIterator result);
255258
template<class InputIterator, class Size, class NoThrowForwardIterator>
256259
constexpr NoThrowForwardIterator uninitialized_copy_n(InputIterator first, // freestanding
257260
Size n,
258261
NoThrowForwardIterator result);
259262
template<class ExecutionPolicy, class ForwardIterator, class Size,
260263
class NoThrowForwardIterator>
261-
NoThrowForwardIterator uninitialized_copy_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
262-
ForwardIterator first, Size n,
264+
NoThrowForwardIterator uninitialized_copy_n(ExecutionPolicy&& exec, // freestanding-deleted,
265+
ForwardIterator first, // see \ref{algorithms.parallel.overloads}
266+
Size n,
263267
NoThrowForwardIterator result);
264268

265269
namespace ranges {
@@ -289,8 +293,9 @@
289293
InputIterator last,
290294
NoThrowForwardIterator result);
291295
template<class ExecutionPolicy, class ForwardIterator, class NoThrowForwardIterator>
292-
NoThrowForwardIterator uninitialized_move(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
293-
ForwardIterator first, ForwardIterator last,
296+
NoThrowForwardIterator uninitialized_move(ExecutionPolicy&& exec, // freestanding-deleted,
297+
ForwardIterator first, // see \ref{algorithms.parallel.overloads}
298+
ForwardIterator last,
294299
NoThrowForwardIterator result);
295300
template<class InputIterator, class Size, class NoThrowForwardIterator>
296301
constexpr pair<InputIterator, NoThrowForwardIterator>
@@ -299,8 +304,9 @@
299304
template<class ExecutionPolicy, class ForwardIterator, class Size,
300305
class NoThrowForwardIterator>
301306
pair<ForwardIterator, NoThrowForwardIterator>
302-
uninitialized_move_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
303-
ForwardIterator first, Size n, NoThrowForwardIterator result);
307+
uninitialized_move_n(ExecutionPolicy&& exec, // freestanding-deleted,
308+
ForwardIterator first, Size n, // see \ref{algorithms.parallel.overloads}
309+
NoThrowForwardIterator result);
304310

305311
namespace ranges {
306312
template<class I, class O>
@@ -329,16 +335,18 @@
329335
constexpr void uninitialized_fill(NoThrowForwardIterator first, // freestanding
330336
NoThrowForwardIterator last, const T& x);
331337
template<class ExecutionPolicy, class NoThrowForwardIterator, class T>
332-
void uninitialized_fill(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
333-
NoThrowForwardIterator first, NoThrowForwardIterator last,
338+
void uninitialized_fill(ExecutionPolicy&& exec, // freestanding-deleted,
339+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
340+
NoThrowForwardIterator last,
334341
const T& x);
335342
template<class NoThrowForwardIterator, class Size, class T>
336343
constexpr NoThrowForwardIterator
337344
uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x); // freestanding
338345
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size, class T>
339346
NoThrowForwardIterator
340-
uninitialized_fill_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
341-
NoThrowForwardIterator first, Size n, const T& x);
347+
uninitialized_fill_n(ExecutionPolicy&& exec, // freestanding-deleted,
348+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
349+
Size n, const T& x);
342350

343351
namespace ranges {
344352
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T>
@@ -370,14 +378,15 @@
370378
constexpr void destroy(NoThrowForwardIterator first, // freestanding
371379
NoThrowForwardIterator last);
372380
template<class ExecutionPolicy, class NoThrowForwardIterator>
373-
void destroy(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
374-
NoThrowForwardIterator first, NoThrowForwardIterator last);
381+
void destroy(ExecutionPolicy&& exec, // freestanding-deleted,
382+
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
383+
NoThrowForwardIterator last);
375384
template<class NoThrowForwardIterator, class Size>
376385
constexpr NoThrowForwardIterator destroy_n(NoThrowForwardIterator first, // freestanding
377386
Size n);
378387
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size>
379-
NoThrowForwardIterator destroy_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
380-
NoThrowForwardIterator first, Size n);
388+
NoThrowForwardIterator destroy_n(ExecutionPolicy&& exec, // freestanding-deleted,
389+
NoThrowForwardIterator first, Size n); // see \ref{algorithms.parallel.overloads}
381390

382391
namespace ranges {
383392
template<@\libconcept{destructible}@ T>

0 commit comments

Comments
 (0)