Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
634a110
LWG3343 Ordering of calls to unlock() and notify_all() in Effects ele…
burblebee Nov 15, 2025
5840bc6
LWG3454 pointer_traits::pointer_to should be constexpr
burblebee Nov 15, 2025
05616c2
LWG4015 LWG 3973 broke const overloads of std::optional monadic opera…
burblebee Dec 2, 2025
8cb9d59
LWG4230 simd<complex>::real/imag is overconstrained
burblebee Dec 3, 2025
094ebc9
LWG4251 Move assignment for indirect unnecessarily requires copy cons…
burblebee Dec 3, 2025
6ea4bf1
LWG4260 Query objects must be default constructible
burblebee Dec 3, 2025
88ca82c
LWG4272 For rank == 0, layout_stride is atypically convertible
burblebee Dec 3, 2025
6feb7ee
LWG4302 Problematic vector_sum_of_squares wording
burblebee Dec 3, 2025
6c0b7bd
LWG4304 std::optional<NonReturnable&> is ill-formed due to value_or
burblebee Dec 3, 2025
dd21c6a
LWG4308 std::optional<T&>::iterator can't be a contiguous iterator fo…
burblebee Dec 3, 2025
9cfbbb4
LWG4316 {can_}substitute specification is ill-formed
burblebee Dec 3, 2025
03aed09
LWG4358 [exec.as.awaitable] is using "Preconditions:" when it should …
burblebee Dec 3, 2025
b68d2ce
LWG4360 awaitable-sender concept should qualify use of awaitable-rece…
burblebee Dec 3, 2025
31492d9
LWG4369 check-types function for upon_error and upon_stopped is wrong
burblebee Dec 3, 2025
5d1d883
LWG4376 ABI tag in return type of [simd.mask.unary] is overconstrained
burblebee Dec 3, 2025
1850d3f
LWG4383 constant_wrapper's pseudo-mutators are underconstrained
burblebee Dec 3, 2025
89fdbd0
LWG4388 Align new definition of va_start with C23
burblebee Dec 3, 2025
139cb32
LWG4396 Improve inplace_vector(from_range_t, R&& rg)
burblebee Dec 3, 2025
0b9e631
LWG4420 [simd] conversions (constructor, load, stores, gather, and sc…
burblebee Dec 3, 2025
3e79211
LWG4424 meta::define_aggregate should require a class type
burblebee Dec 3, 2025
0f80c79
LWG4427 meta::dealias needs to work with things that aren't entities
burblebee Dec 3, 2025
d0e1cd9
LWG4428 Metafunctions should not be defined in terms of constant sube…
burblebee Dec 3, 2025
d404774
LWG4429 meta::alignment_of should exclude data member description of …
burblebee Dec 3, 2025
8bdc478
LWG4430 from_chars should not parse "0b" base prefixes
burblebee Dec 3, 2025
e8bf93b
LWG4431 Parallel std::ranges::destroy should allow exceptions
burblebee Dec 3, 2025
8115936
LWG4432 Clarify element initialization for meta::reflect_constant_array
burblebee Dec 3, 2025
d0970d9
LWG4433 Incorrect query for C language linkage
burblebee Dec 3, 2025
f4c3e69
LWG4434 meta::is_accessible does not need to consider incomplete D
burblebee Dec 3, 2025
6ca1f74
LWG4435 meta::has_identifier doesn't handle all types
burblebee Dec 3, 2025
ee26fb0
LWG4438 Bad expression in [exec.when.all]
burblebee Dec 3, 2025
4fd2a83
LWG4439 std::optional<T&>::swap possibly selects ADL-found swap
burblebee Dec 3, 2025
003e17d
LWG4440 Forward declarations of entities need also in entries
burblebee Dec 4, 2025
1d7badc
LWG4441 ranges::rotate do not handle sized-but-not-sized-sentinel ran…
burblebee Dec 4, 2025
214e746
LWG4442 Clarify expr and fn for meta::reflect_object and meta::reflec…
burblebee Dec 4, 2025
bb61329
LWG4443 Clean up identifier comparisons in meta::define_aggregate
burblebee Dec 4, 2025
9ddee8c
LWG4444 Fix default template arguments for ranges::replace and ranges…
burblebee Dec 4, 2025
97f3cdb
LWG4445 sch_ must not be in moved-from state
burblebee Dec 4, 2025
ca555d2
LWG4446 Bad phrasing for SCHED(s)
burblebee Dec 4, 2025
f499a16
LWG4447 Remove unnecessary sizeof…(Env) > 1 condition
burblebee Dec 4, 2025
3e4bb92
LWG4448 Do not forward fn in completion_signatures
burblebee Dec 4, 2025
860abf2
LWG4449 define_aggregate members must be public
burblebee Dec 4, 2025
6135e94
LWG4450 std::atomic_ref<T>::store_key should be disabled for const T
burblebee Dec 4, 2025
b20c812
LWG4451 make_shared should not refer to a type U[N] for runtime N
burblebee Dec 4, 2025
ec6c665
LWG4452 Make deref-move constexpr
burblebee Dec 4, 2025
cd7f9b6
LWG4455 Add missing constraint to basic-sender::get_completion_signat…
burblebee Dec 4, 2025
64b6de3
LWG4456 Decay Data and Child in make-sender
burblebee Dec 4, 2025
d1d6281
LWG4459 Protect get_completion_signatures fold expression from overlo…
burblebee Dec 4, 2025
361c567
LWG4461 stop-when needs to evaluate unstoppable tokens
burblebee Dec 4, 2025
914f652
LWG4462 Algorithm requirements don't describe semantics of s - i well
burblebee Dec 4, 2025
7ab8b1f
LWG4463 Change wording to 'model' from 'subsumes' in [algorithms.para…
burblebee Dec 4, 2025
4fee354
LWG4464 [alg.merge] Wording tweaks
burblebee Dec 4, 2025
595213e
LWG4465 §[alg.partitions] Clarify Returns: element
burblebee Dec 4, 2025
5b29b12
[optional.dtor] Fix double negative in wording added by LWG4015.
burblebee Dec 4, 2025
0e6d182
[optional.swap] Fix singular->plural tense that was missed in LWG4015.
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 @@ -7152,26 +7157,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 @@ -7180,24 +7185,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 @@ -8261,7 +8266,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 @@ -8386,8 +8392,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 @@ -9007,7 +9015,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 @@ -9391,7 +9400,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 @@ -9960,14 +9970,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 @@ -10097,12 +10107,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 @@ -10127,7 +10137,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 @@ -10264,7 +10274,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 @@ -13541,7 +13552,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