Skip to content

Commit 7b50fa3

Browse files
committed
P3787R2 Adjoints to "Enabling list-initialization for algorithms": uninitialized_fill
Fixes NB FR-027-267 (C++26 CD).
1 parent 4d1fbb7 commit 7b50fa3

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

source/algorithms.tex

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14130,7 +14130,8 @@
1413014130

1413114131
\indexlibraryglobal{uninitialized_fill}%
1413214132
\begin{itemdecl}
14133-
template<class NoThrowForwardIterator, class T>
14133+
template<class NoThrowForwardIterator,
14134+
class T = iterator_traits<NoThrowForwardIterator>::value_type>
1413414135
constexpr void uninitialized_fill(NoThrowForwardIterator first,
1413514136
NoThrowForwardIterator last, const T& x);
1413614137
\end{itemdecl}
@@ -14148,10 +14149,10 @@
1414814149
\indexlibraryglobal{uninitialized_fill}%
1414914150
\begin{itemdecl}
1415014151
namespace ranges {
14151-
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T>
14152+
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T = iter_value_t<I>>
1415214153
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
1415314154
constexpr I uninitialized_fill(I first, S last, const T& x);
14154-
template<@\exposconcept{nothrow-forward-range}@ R, class T>
14155+
template<@\exposconcept{nothrow-forward-range}@ R, class T = range_value_t<R>>
1415514156
requires @\libconcept{constructible_from}@<range_value_t<R>, const T&>
1415614157
constexpr borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x);
1415714158
}
@@ -14170,7 +14171,8 @@
1417014171

1417114172
\indexlibraryglobal{uninitialized_fill_n}%
1417214173
\begin{itemdecl}
14173-
template<class NoThrowForwardIterator, class Size, class T>
14174+
template<class NoThrowForwardIterator, class Size,
14175+
class T = iterator_traits<NoThrowForwardIterator>::value_type>
1417414176
constexpr NoThrowForwardIterator
1417514177
uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x);
1417614178
\end{itemdecl}
@@ -14189,7 +14191,7 @@
1418914191
\indexlibraryglobal{uninitialized_fill_n}%
1419014192
\begin{itemdecl}
1419114193
namespace ranges {
14192-
template<@\exposconcept{nothrow-forward-iterator}@ I, class T>
14194+
template<@\exposconcept{nothrow-forward-iterator}@ I, class T = iter_value_t<I>>
1419314195
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
1419414196
constexpr I uninitialized_fill_n(I first, iter_difference_t<I> n, const T& x);
1419514197
}

source/memory.tex

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -413,47 +413,52 @@
413413
O ofirst, S olast); // see \ref{algorithms.parallel.overloads}
414414
}
415415

416-
template<class NoThrowForwardIterator, class T>
416+
template<class NoThrowForwardIterator,
417+
class T = iterator_traits<NoThrowForwardIterator>::value_type>
417418
constexpr void uninitialized_fill(NoThrowForwardIterator first, // freestanding
418419
NoThrowForwardIterator last, const T& x);
419-
template<class ExecutionPolicy, class NoThrowForwardIterator, class T>
420+
template<class ExecutionPolicy, class NoThrowForwardIterator,
421+
class T = iterator_traits<NoThrowForwardIterator>::value_type>
420422
void uninitialized_fill(ExecutionPolicy&& exec, // freestanding-deleted,
421423
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
422424
NoThrowForwardIterator last,
423425
const T& x);
424-
template<class NoThrowForwardIterator, class Size, class T>
426+
template<class NoThrowForwardIterator, class Size,
427+
class T = iterator_traits<NoThrowForwardIterator>::value_type>
425428
constexpr NoThrowForwardIterator
426429
uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x); // freestanding
427-
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size, class T>
430+
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size,
431+
class T = iterator_traits<NoThrowForwardIterator>::value_type>
428432
NoThrowForwardIterator
429433
uninitialized_fill_n(ExecutionPolicy&& exec, // freestanding-deleted,
430434
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
431435
Size n, const T& x);
432436

433437
namespace ranges {
434-
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T>
438+
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T = iter_value_t<I>>
435439
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
436440
constexpr I uninitialized_fill(I first, S last, const T& x); // freestanding
437-
template<@\exposconcept{nothrow-forward-range}@ R, class T>
441+
template<@\exposconcept{nothrow-forward-range}@ R, class T = iter_value_t<I>>
438442
requires @\libconcept{constructible_from}@<range_value_t<R>, const T&>
439443
constexpr borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x); // freestanding
440444

441-
template<@\exposconcept{nothrow-forward-iterator}@ I, class T>
445+
template<@\exposconcept{nothrow-forward-iterator}@ I, class T = iter_value_t<I>>
442446
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
443447
constexpr I uninitialized_fill_n(I first, // freestanding
444448
iter_difference_t<I> n, const T& x);
445449

446450
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{nothrow-random-access-iterator}@ I,
447-
@\exposconcept{nothrow-sized-sentinel-for}@<I> S, class T>
451+
@\exposconcept{nothrow-sized-sentinel-for}@<I> S, class T = iter_value_t<I>>
448452
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
449453
I uninitialized_fill(Ep&& exec, I first, S last, const T& x); // freestanding-deleted,
450454
// see \ref{algorithms.parallel.overloads}
451-
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{nothrow-sized-random-access-range}@ R, class T>
455+
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{nothrow-sized-random-access-range}@ R,
456+
class T = range_value_t<R>>
452457
requires @\libconcept{constructible_from}@<range_value_t<R>, const T&>
453458
borrowed_iterator_t<R> uninitialized_fill(Ep&& exec, R&& r, // freestanding-deleted,
454459
const T& x); // see \ref{algorithms.parallel.overloads}
455460

456-
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{nothrow-random-access-iterator}@ I, class T>
461+
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{nothrow-random-access-iterator}@ I, class T = iter_value_t<I>>
457462
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
458463
I uninitialized_fill_n(Ep&& exec, I first, // freestanding-deleted,
459464
iter_difference_t<I> n, const T& x); // see \ref{algorithms.parallel.overloads}

source/support.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,8 @@
568568
\begin{codeblock}
569569
#define @\defnlibxname{cpp_lib_adaptor_iterator_pair_constructor}@ 202106L // also in \libheader{stack}, \libheader{queue}
570570
#define @\defnlibxname{cpp_lib_addressof_constexpr}@ 201603L // freestanding, also in \libheader{memory}
571-
#define @\defnlibxname{cpp_lib_algorithm_default_value_type}@ 202403L
572-
// also in \libheader{algorithm}, \libheader{ranges}, \libheader{string}, \libheader{deque}, \libheader{list}, \libheader{forward_list}, \libheader{vector}
571+
#define @\defnlibxname{cpp_lib_algorithm_default_value_type}@ 202603L
572+
// also in \libheader{algorithm}, \libheader{ranges}, \libheader{string}, \libheader{deque}, \libheader{list}, \libheader{forward_list}, \libheader{vector}, \libheader{memory}
573573
#define @\defnlibxname{cpp_lib_algorithm_iterator_requirements}@ 202207L
574574
// also in \libheader{algorithm}, \libheader{numeric}, \libheader{memory}
575575
#define @\defnlibxname{cpp_lib_aligned_accessor}@ 202411L // freestanding, also in \libheader{mdspan}

0 commit comments

Comments
 (0)