Skip to content

Commit 9f69aa7

Browse files
jensmaurertkoeppe
authored andcommitted
P3787R2 Adjoints to "Enabling list-initialization for algorithms": uninitialized_fill
Fixes NB FR 027-267 (C++26 CD).
1 parent ad6fedb commit 9f69aa7

3 files changed

Lines changed: 24 additions & 17 deletions

File tree

source/algorithms.tex

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

1412414124
\indexlibraryglobal{uninitialized_fill}%
1412514125
\begin{itemdecl}
14126-
template<class NoThrowForwardIterator, class T>
14126+
template<class NoThrowForwardIterator,
14127+
class T = iterator_traits<NoThrowForwardIterator>::value_type>
1412714128
constexpr void uninitialized_fill(NoThrowForwardIterator first,
1412814129
NoThrowForwardIterator last, const T& x);
1412914130
\end{itemdecl}
@@ -14141,10 +14142,10 @@
1414114142
\indexlibraryglobal{uninitialized_fill}%
1414214143
\begin{itemdecl}
1414314144
namespace ranges {
14144-
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T>
14145+
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T = iter_value_t<I>>
1414514146
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
1414614147
constexpr I uninitialized_fill(I first, S last, const T& x);
14147-
template<@\exposconcept{nothrow-forward-range}@ R, class T>
14148+
template<@\exposconcept{nothrow-forward-range}@ R, class T = range_value_t<R>>
1414814149
requires @\libconcept{constructible_from}@<range_value_t<R>, const T&>
1414914150
constexpr borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x);
1415014151
}
@@ -14163,7 +14164,8 @@
1416314164

1416414165
\indexlibraryglobal{uninitialized_fill_n}%
1416514166
\begin{itemdecl}
14166-
template<class NoThrowForwardIterator, class Size, class T>
14167+
template<class NoThrowForwardIterator, class Size,
14168+
class T = iterator_traits<NoThrowForwardIterator>::value_type>
1416714169
constexpr NoThrowForwardIterator
1416814170
uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x);
1416914171
\end{itemdecl}
@@ -14182,7 +14184,7 @@
1418214184
\indexlibraryglobal{uninitialized_fill_n}%
1418314185
\begin{itemdecl}
1418414186
namespace ranges {
14185-
template<@\exposconcept{nothrow-forward-iterator}@ I, class T>
14187+
template<@\exposconcept{nothrow-forward-iterator}@ I, class T = iter_value_t<I>>
1418614188
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
1418714189
constexpr I uninitialized_fill_n(I first, iter_difference_t<I> n, const T& x);
1418814190
}

source/memory.tex

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

418-
template<class NoThrowForwardIterator, class T>
418+
template<class NoThrowForwardIterator,
419+
class T = iterator_traits<NoThrowForwardIterator>::value_type>
419420
constexpr void uninitialized_fill(NoThrowForwardIterator first, // freestanding
420421
NoThrowForwardIterator last, const T& x);
421-
template<class ExecutionPolicy, class NoThrowForwardIterator, class T>
422+
template<class ExecutionPolicy, class NoThrowForwardIterator,
423+
class T = iterator_traits<NoThrowForwardIterator>::value_type>
422424
void uninitialized_fill(ExecutionPolicy&& exec, // freestanding-deleted,
423425
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
424426
NoThrowForwardIterator last,
425427
const T& x);
426-
template<class NoThrowForwardIterator, class Size, class T>
428+
template<class NoThrowForwardIterator, class Size,
429+
class T = iterator_traits<NoThrowForwardIterator>::value_type>
427430
constexpr NoThrowForwardIterator
428431
uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x); // freestanding
429-
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size, class T>
432+
template<class ExecutionPolicy, class NoThrowForwardIterator, class Size,
433+
class T = iterator_traits<NoThrowForwardIterator>::value_type>
430434
NoThrowForwardIterator
431435
uninitialized_fill_n(ExecutionPolicy&& exec, // freestanding-deleted,
432436
NoThrowForwardIterator first, // see \ref{algorithms.parallel.overloads}
433437
Size n, const T& x);
434438

435439
namespace ranges {
436-
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T>
440+
template<@\exposconcept{nothrow-forward-iterator}@ I, @\exposconcept{nothrow-sentinel-for}@<I> S, class T = iter_value_t<I>>
437441
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
438442
constexpr I uninitialized_fill(I first, S last, const T& x); // freestanding
439-
template<@\exposconcept{nothrow-forward-range}@ R, class T>
443+
template<@\exposconcept{nothrow-forward-range}@ R, class T = range_value_t<R>>
440444
requires @\libconcept{constructible_from}@<range_value_t<R>, const T&>
441445
constexpr borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x); // freestanding
442446

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

448452
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{nothrow-random-access-iterator}@ I,
449-
@\exposconcept{nothrow-sized-sentinel-for}@<I> S, class T>
453+
@\exposconcept{nothrow-sized-sentinel-for}@<I> S, class T = iter_value_t<I>>
450454
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
451455
I uninitialized_fill(Ep&& exec, I first, S last, const T& x); // freestanding-deleted,
452456
// see \ref{algorithms.parallel.overloads}
453-
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{nothrow-sized-random-access-range}@ R, class T>
457+
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{nothrow-sized-random-access-range}@ R,
458+
class T = range_value_t<R>>
454459
requires @\libconcept{constructible_from}@<range_value_t<R>, const T&>
455460
borrowed_iterator_t<R> uninitialized_fill(Ep&& exec, R&& r, // freestanding-deleted,
456461
const T& x); // see \ref{algorithms.parallel.overloads}
457462

458-
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{nothrow-random-access-iterator}@ I, class T>
463+
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{nothrow-random-access-iterator}@ I, class T = iter_value_t<I>>
459464
requires @\libconcept{constructible_from}@<iter_value_t<I>, const T&>
460465
I uninitialized_fill_n(Ep&& exec, I first, // freestanding-deleted,
461466
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)