Skip to content
Open
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
bf575fb
LWG3343 Ordering of calls to unlock() and notify_all() in Effects ele…
burblebee Nov 15, 2025
97383b5
LWG3454 pointer_traits::pointer_to should be constexpr
burblebee Nov 15, 2025
2ea2ab9
LWG4015 LWG 3973 broke const overloads of std::optional monadic opera…
burblebee Dec 2, 2025
acfeaba
LWG4230 simd<complex>::real/imag is overconstrained
burblebee Dec 3, 2025
c7e67b6
LWG4251 Move assignment for indirect unnecessarily requires copy cons…
burblebee Dec 3, 2025
b92f18b
LWG4260 Query objects must be default constructible
burblebee Dec 3, 2025
655765a
LWG4272 For rank == 0, layout_stride is atypically convertible
burblebee Dec 3, 2025
01bff15
LWG4302 Problematic vector_sum_of_squares wording
burblebee Dec 3, 2025
c0c704b
LWG4304 std::optional<NonReturnable&> is ill-formed due to value_or
burblebee Dec 3, 2025
990f680
LWG4308 std::optional<T&>::iterator can't be a contiguous iterator fo…
burblebee Dec 3, 2025
3dcd790
LWG4316 {can_}substitute specification is ill-formed
burblebee Dec 3, 2025
03c5d17
LWG4358 [exec.as.awaitable] is using "Preconditions:" when it should …
burblebee Dec 3, 2025
5deca0b
LWG4360 awaitable-sender concept should qualify use of awaitable-rece…
burblebee Dec 3, 2025
337988d
LWG4369 check-types function for upon_error and upon_stopped is wrong
burblebee Dec 3, 2025
25c0671
LWG4376 ABI tag in return type of [simd.mask.unary] is overconstrained
burblebee Dec 3, 2025
65b4fcd
LWG4383 constant_wrapper's pseudo-mutators are underconstrained
burblebee Dec 3, 2025
8bb3a00
LWG4388 Align new definition of va_start with C23
burblebee Dec 3, 2025
09251f3
LWG4396 Improve inplace_vector(from_range_t, R&& rg)
burblebee Dec 3, 2025
df419aa
LWG4420 [simd] conversions (constructor, load, stores, gather, and sc…
burblebee Dec 3, 2025
f3a2fd9
LWG4424 meta::define_aggregate should require a class type
burblebee Dec 3, 2025
872fa85
LWG4427 meta::dealias needs to work with things that aren't entities
burblebee Dec 3, 2025
599380f
LWG4428 Metafunctions should not be defined in terms of constant sube…
burblebee Dec 3, 2025
60b2a5c
LWG4429 meta::alignment_of should exclude data member description of …
burblebee Dec 3, 2025
b34d02f
LWG4430 from_chars should not parse "0b" base prefixes
burblebee Dec 3, 2025
4d568a4
LWG4431 Parallel std::ranges::destroy should allow exceptions
burblebee Dec 3, 2025
82ddaa6
LWG4432 Clarify element initialization for meta::reflect_constant_array
burblebee Dec 3, 2025
1c1c5a3
LWG4433 Incorrect query for C language linkage
burblebee Dec 3, 2025
8c042ff
LWG4434 meta::is_accessible does not need to consider incomplete D
burblebee Dec 3, 2025
3a24446
LWG4435 meta::has_identifier doesn't handle all types
burblebee Dec 3, 2025
bb98d62
LWG4438 Bad expression in [exec.when.all]
burblebee Dec 3, 2025
2b5e9bf
LWG4439 std::optional<T&>::swap possibly selects ADL-found swap
burblebee Dec 3, 2025
e192323
LWG4440 Forward declarations of entities need also in entries
burblebee Dec 4, 2025
d862d34
LWG4441 ranges::rotate do not handle sized-but-not-sized-sentinel ran…
burblebee Dec 4, 2025
7e73d41
LWG4442 Clarify expr and fn for meta::reflect_object and meta::reflec…
burblebee Dec 4, 2025
4fdadc2
LWG4443 Clean up identifier comparisons in meta::define_aggregate
burblebee Dec 4, 2025
56e426e
FIXUP LWG4429: Change \perp to \bot in case that was the intent (was …
burblebee Dec 4, 2025
4c4c8d2
LWG4444 Fix default template arguments for ranges::replace and ranges…
burblebee Dec 4, 2025
a32b8bf
LWG4445 sch_ must not be in moved-from state
burblebee Dec 4, 2025
3daccf9
LWG4446 Bad phrasing for SCHED(s)
burblebee Dec 4, 2025
ceea8a4
LWG4447 Remove unnecessary sizeof…(Env) > 1 condition
burblebee Dec 4, 2025
96853a0
LWG4448 Do not forward fn in completion_signatures
burblebee Dec 4, 2025
d44f492
LWG4449 define_aggregate members must be public
burblebee Dec 4, 2025
5dadda7
LWG4450 std::atomic_ref<T>::store_key should be disabled for const T
burblebee Dec 4, 2025
ce23d66
LWG4451 make_shared should not refer to a type U[N] for runtime N
burblebee Dec 4, 2025
ea71fdd
LWG4452 Make deref-move constexpr
burblebee Dec 4, 2025
566dbda
LWG4455 Add missing constraint to basic-sender::get_completion_signat…
burblebee Dec 4, 2025
e274317
LWG4456 Decay Data and Child in make-sender
burblebee Dec 4, 2025
aaa993f
LWG4459 Protect get_completion_signatures fold expression from overlo…
burblebee Dec 4, 2025
5289650
LWG4461 stop-when needs to evaluate unstoppable tokens
burblebee Dec 4, 2025
87d89ef
LWG4462 Algorithm requirements don't describe semantics of s - i well
burblebee Dec 4, 2025
578c73f
LWG4463 Change wording to 'model' from 'subsumes' in [algorithms.para…
burblebee Dec 4, 2025
e353581
LWG4464 [alg.merge] Wording tweaks
burblebee Dec 4, 2025
bd0df64
LWG4465 §[alg.partitions] Clarify Returns: element
burblebee Dec 4, 2025
537b284
FIXUP LWG3343: Keep "sequenced after" on same line (as per review req…
burblebee Dec 4, 2025
033f7e5
[optional.dtor] Fix double negative in wording added by LWG4015.
burblebee Dec 4, 2025
d892ebc
[optional.swap] Fix singular->plural tense that was missed in LWG4015.
burblebee Dec 4, 2025
997c5d0
FIXUP LWG4015: Break lines after comma as suggested in review.
burblebee Dec 4, 2025
4d67aae
FIXUP LWG4451: "known" -> "unknown"
burblebee Dec 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 45 additions & 34 deletions source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@
\end{codeblock}
For each iterator \tcode{i} and sentinel \tcode{s}
produced from a range \tcode{r},
the semantics of \tcode{s - i} has the same type, value, and value category
the semantics of \tcode{s - i}
are the same as those of an expression that
has the same type, value, and value category
as \tcode{ranges::distance(i, s)}.
\begin{note}
The implementation can use \tcode{ranges::distance(r)}
Expand Down Expand Up @@ -379,7 +381,9 @@
\tcode{BinaryOperation1},
\tcode{BinaryOperation2},
\tcode{BinaryDivideOp}, or
constrained by a concept that subsumes \libconcept{regular_invocable}
constrained by a concept
whose semantic requirements include
that the type models \libconcept{regular_invocable}
and the operators used by the analogous overloads to these parallel algorithms
that are formed by an invocation
with the specified default predicate or operation (where applicable)
Expand Down Expand Up @@ -2097,27 +2101,28 @@

namespace ranges {
template<@\libconcept{input_iterator}@ I, @\libconcept{sentinel_for}@<I> S, class Proj = identity,
class T1 = projected_value_t<I, Proj>, class T2 = T1>
class T1 = projected_value_t<I, Proj>, class T2 = iter_value_t<I>>
requires @\libconcept{indirectly_writable}@<I, const T2&> &&
@\libconcept{indirect_binary_predicate}@<ranges::equal_to, projected<I, Proj>, const T1*>
constexpr I
replace(I first, S last, const T1& old_value, const T2& new_value, Proj proj = {});
template<@\libconcept{input_range}@ R, class Proj = identity,
class T1 = projected_value_t<iterator_t<R>, Proj>, class T2 = T1>
class T1 = projected_value_t<iterator_t<R>, Proj>, class T2 = range_value_t<R>>
requires @\libconcept{indirectly_writable}@<iterator_t<R>, const T2&> &&
@\libconcept{indirect_binary_predicate}@<ranges::equal_to,
projected<iterator_t<R>, Proj>, const T1*>
constexpr borrowed_iterator_t<R>
replace(R&& r, const T1& old_value, const T2& new_value, Proj proj = {});

template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S,
class Proj = identity, class T1 = projected_value_t<I, Proj>, class T2 = T1>
class Proj = identity,
class T1 = projected_value_t<I, Proj>, class T2 = iter_value_t<I>>
requires @\libconcept{indirectly_writable}@<I, const T2&> &&
@\libconcept{indirect_binary_predicate}@<ranges::equal_to, projected<I, Proj>, const T1*>
I replace(Ep&& exec, I first, S last,
const T1& old_value, const T2& new_value, Proj proj = {}); // freestanding-deleted
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, class Proj = identity,
class T1 = projected_value_t<iterator_t<R>, Proj>, class T2 = T1>
class T1 = projected_value_t<iterator_t<R>, Proj>, class T2 = range_value_t<R>>
requires @\libconcept{indirectly_writable}@<iterator_t<R>, const T2&> &&
@\libconcept{indirect_binary_predicate}@<ranges::equal_to,
projected<iterator_t<R>, Proj>, const T1*>
Expand All @@ -2126,24 +2131,24 @@
Proj proj = {}); // freestanding-deleted

template<@\libconcept{input_iterator}@ I, @\libconcept{sentinel_for}@<I> S, class Proj = identity,
class T = projected_value_t<I, Proj>,
class T = iter_value_t<I>,
@\libconcept{indirect_unary_predicate}@<projected<I, Proj>> Pred>
requires @\libconcept{indirectly_writable}@<I, const T&>
constexpr I replace_if(I first, S last, Pred pred, const T& new_value, Proj proj = {});
template<@\libconcept{input_range}@ R, class Proj = identity, class T = projected_value_t<I, Proj>,
template<@\libconcept{input_range}@ R, class Proj = identity, class T = range_value_t<R>,
@\libconcept{indirect_unary_predicate}@<projected<iterator_t<R>, Proj>> Pred>
requires @\libconcept{indirectly_writable}@<iterator_t<R>, const T&>
constexpr borrowed_iterator_t<R>
replace_if(R&& r, Pred pred, const T& new_value, Proj proj = {});

template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S,
class Proj = identity, class T = projected_value_t<I, Proj>,
class Proj = identity, class T = iter_value_t<I>,
@\libconcept{indirect_unary_predicate}@<projected<I, Proj>> Pred>
requires @\libconcept{indirectly_writable}@<I, const T&>
I replace_if(Ep&& exec, I first, S last, Pred pred,
const T& new_value, Proj proj = {}); // freestanding-deleted
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, class Proj = identity,
class T = projected_value_t<iterator_t<R>, Proj>,
class T = range_value_t<R>,
@\libconcept{indirect_unary_predicate}@<projected<iterator_t<R>, Proj>> Pred>
requires @\libconcept{indirectly_writable}@<iterator_t<R>, const T&>
borrowed_iterator_t<R>
Expand Down Expand Up @@ -7149,26 +7154,26 @@
Predicate pred, const T& new_value);

template<@\libconcept{input_iterator}@ I, @\libconcept{sentinel_for}@<I> S, class Proj = identity,
class T1 = projected_value_t<I, Proj>, class T2 = T1>
class T1 = projected_value_t<I, Proj>, class T2 = iter_value_t<I>>
requires @\libconcept{indirectly_writable}@<I, const T2&> &&
@\libconcept{indirect_binary_predicate}@<ranges::equal_to, projected<I, Proj>, const T1*>
constexpr I
ranges::replace(I first, S last, const T1& old_value, const T2& new_value, Proj proj = {});
template<@\libconcept{input_range}@ R, class Proj = identity,
class T1 = projected_value_t<iterator_t<R>, Proj>, class T2 = T1>
class T1 = projected_value_t<iterator_t<R>, Proj>, class T2 = range_value_t<R>>
requires @\libconcept{indirectly_writable}@<iterator_t<R>, const T2&> &&
@\libconcept{indirect_binary_predicate}@<ranges::equal_to, projected<iterator_t<R>, Proj>, const T1*>
constexpr borrowed_iterator_t<R>
ranges::replace(R&& r, const T1& old_value, const T2& new_value, Proj proj = {});

template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S,
class Proj = identity, class T1 = projected_value_t<I, Proj>, class T2 = T1>
class Proj = identity, class T1 = projected_value_t<I, Proj>, class T2 = iter_value_t<I>>
requires @\libconcept{indirectly_writable}@<I, const T2&> &&
@\libconcept{indirect_binary_predicate}@<ranges::equal_to, projected<I, Proj>, const T1*>
I ranges::replace(Ep&& exec, I first, S last,
const T1& old_value, const T2& new_value, Proj proj = {});
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, class Proj = identity,
class T1 = projected_value_t<iterator_t<R>, Proj>, class T2 = T1>
class T1 = projected_value_t<iterator_t<R>, Proj>, class T2 = range_value_t<R>>
requires @\libconcept{indirectly_writable}@<iterator_t<R>, const T2&> &&
@\libconcept{indirect_binary_predicate}@<ranges::equal_to,
projected<iterator_t<R>, Proj>, const T1*>
Expand All @@ -7177,24 +7182,24 @@
Proj proj = {});

template<@\libconcept{input_iterator}@ I, @\libconcept{sentinel_for}@<I> S, class Proj = identity,
class T = projected_value_t<I, Proj>,
class T = iter_value_t<I>,
@\libconcept{indirect_unary_predicate}@<projected<I, Proj>> Pred>
requires @\libconcept{indirectly_writable}@<I, const T&>
constexpr I ranges::replace_if(I first, S last, Pred pred, const T& new_value, Proj proj = {});
template<@\libconcept{input_range}@ R, class Proj = identity, class T = projected_value_t<iterator_t<R>, Proj>,
template<@\libconcept{input_range}@ R, class Proj = identity, class T = range_value_t<R>,
@\libconcept{indirect_unary_predicate}@<projected<iterator_t<R>, Proj>> Pred>
requires @\libconcept{indirectly_writable}@<iterator_t<R>, const T&>
constexpr borrowed_iterator_t<R>
ranges::replace_if(R&& r, Pred pred, const T& new_value, Proj proj = {});

template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S,
class Proj = identity, class T = projected_value_t<I, Proj>,
class Proj = identity, class T = iter_value_t<I>,
@\libconcept{indirect_unary_predicate}@<projected<I, Proj>> Pred>
requires @\libconcept{indirectly_writable}@<I, const T&>
I ranges::replace_if(Ep&& exec, I first, S last, Pred pred,
const T& new_value, Proj proj = {});
template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, class Proj = identity,
class T = projected_value_t<iterator_t<R>, Proj>,
class T = range_value_t<R>,
@\libconcept{indirect_unary_predicate}@<projected<iterator_t<R>, Proj>> Pred>
requires @\libconcept{indirectly_writable}@<iterator_t<R>, const T&>
borrowed_iterator_t<R>
Expand Down Expand Up @@ -8256,7 +8261,8 @@
\effects
Equivalent to:
\begin{codeblock}
return ranges::rotate(std::forward<Ep>(exec), ranges::begin(r), middle, ranges::end(r));
return ranges::rotate(std::forward<Ep>(exec), ranges::begin(r), middle,
ranges::begin(r) + ranges::distance(r));
\end{codeblock}
\end{itemdescr}

Expand Down Expand Up @@ -8381,8 +8387,10 @@
\effects
Equivalent to:
\begin{codeblock}
return ranges::rotate_copy(std::forward<Ep>(exec), ranges::begin(r), middle, ranges::end(r),
ranges::begin(result_r), ranges::end(result_r));
return ranges::rotate_copy(std::forward<Ep>(exec), ranges::begin(r), middle,
ranges::begin(r) + ranges::distance(r),
ranges::begin(result_r),
ranges::begin(result_r) + ranges::distance(result_r));
\end{codeblock}
\end{itemdescr}

Expand Down Expand Up @@ -9002,7 +9010,8 @@
Equivalent to:
\begin{codeblock}
return ranges::partial_sort(std::forward<Ep>(exec), ranges::begin(r), middle,
ranges::end(r), comp, proj);
ranges::begin(r) + ranges::distance(r),
comp, proj);
\end{codeblock}
\end{itemdescr}

Expand Down Expand Up @@ -9386,7 +9395,8 @@
\effects
Equivalent to:
\begin{codeblock}
return ranges::nth_element(std::forward<Ep>(exec), ranges::begin(r), nth, ranges::end(r),
return ranges::nth_element(std::forward<Ep>(exec), ranges::begin(r), nth,
ranges::begin(r) + ranges::distance(r),
comp, proj);
\end{codeblock}
\end{itemdescr}
Expand Down Expand Up @@ -9954,14 +9964,14 @@

\pnum
\returns
Let \tcode{o1} be the iterator past the last copied element
in the output range \range{out_true}{last_true},
and \tcode{o2} be the iterator past the last copied element
in the output range \range{out_false}{last_false}.
Let \tcode{$Q$} be the number of elements copied
into the output range \range{out_true}{last_true},
and \tcode{$V$} be the number of elements copied
into the output range \range{out_false}{last_false}.
Returns:
\begin{itemize}
\item \tcode{\{o1, o2\}} for the overloads in namespace \tcode{std}.
\item \tcode{\{first + $N$, o1, o2\}} for the overloads in namespace \tcode{ranges}.
\item \tcode{\{out_true + $Q$, out_false + $V$\}} for the overloads in namespace \tcode{std}.
\item \tcode{\{first + $N$, out_true + $Q$, out_false + $V$\}} for the overloads in namespace \tcode{ranges}.
\end{itemize}

\pnum
Expand Down Expand Up @@ -10091,12 +10101,12 @@
\tcode{proj2} be \tcode{identity\{\}},
for the overloads with no parameters by those names;
\item
$E(\tcode{e1}, \tcode{e1})$ be \tcode{bool(invoke(comp, invoke(proj2, e2), invoke(proj1, e1)))};
$E$ be \tcode{bool(invoke(comp, invoke(proj2, e2), invoke(proj1, e1)))};
\item
$K$ be the smallest integer in \range{0}{last1 - first1}
such that for the element \tcode{e1} in the position \tcode{first1 + $K$}
there are at least $N - K$ elements \tcode{e2}
in \range{first2}{last2} for which $E(\tcode{e1}, \tcode{e1})$ holds,
in \range{first2}{last2} for which $E$ holds,
and be equal to \tcode{last1 - first1}
if no such integer exists.
\begin{note}
Expand All @@ -10121,7 +10131,7 @@
If \tcode{e1} is an element of \range{first1}{last1} and
\tcode{e2} of \range{first2}{last2},
\tcode{e2} is copied into the output range before \tcode{e1}
if and only if $E(\tcode{e1}, \tcode{e1})$ is \tcode{true}.
if and only if $E$ is \tcode{true}.

\pnum
\returns
Expand Down Expand Up @@ -10258,7 +10268,8 @@
Equivalent to:
\begin{codeblock}
return ranges::inplace_merge(std::forward<Ep>(exec), ranges::begin(r), middle,
ranges::end(r), comp, proj);
ranges::begin(r) + ranges::distance(r),
comp, proj);
\end{codeblock}
\end{itemdescr}

Expand Down Expand Up @@ -13535,7 +13546,7 @@
}

template<class I>
decltype(auto) @\exposid{deref-move}@(I& it) {
constexpr decltype(auto) @\exposid{deref-move}@(I& it) {
if constexpr (is_lvalue_reference_v<decltype(*it)>)
return std::move(*it);
else
Expand Down
Loading