-
Notifications
You must be signed in to change notification settings - Fork 809
[Motions 2026 03 lwg 2] P4146R0 C++ Standard Library Immediate Issues #8935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
9d7581a
581d0cb
a50b69c
4fa9e57
0b97fac
9555e19
d323c5a
901b485
8f66474
ca72aac
0514f2f
9ad14eb
1be5f6e
c4ccbb2
e85c4b0
c8b37c1
6fe0756
1743833
073a3ed
c2be2be
140c4a0
0922696
415d2ac
bc841ac
8336444
b36dfac
4ae4a80
5a6ac9c
171ed2c
c4ad4af
a1901ce
b08f0d6
c4e0c92
79358bc
7738975
1e44b03
b87b2ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3633,6 +3633,8 @@ | |
| namespace ranges { | ||
| template<class I, class O> | ||
| using @\libglobal{set_difference_result}@ = in_out_result<I, O>; | ||
| template<class I1, class, I2, class O> | ||
| using @\libglobal{set_difference_truncated_result}@ = in_in_out_result<I1, I2, O>; | ||
|
|
||
| template<@\libconcept{input_iterator}@ I1, @\libconcept{sentinel_for}@<I1> S1, @\libconcept{input_iterator}@ I2, @\libconcept{sentinel_for}@<I2> S2, | ||
| @\libconcept{weakly_incrementable}@ O, class Comp = ranges::less, | ||
|
|
@@ -3653,15 +3655,16 @@ | |
| @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@<O> OutS, class Comp = ranges::less, | ||
| class Proj1 = identity, class Proj2 = identity> | ||
| requires @\libconcept{mergeable}@<I1, I2, O, Comp, Proj1, Proj2> | ||
| set_difference_result<I1, O> | ||
| set_difference_truncated_result<I1, I2, O> | ||
| set_difference(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2, | ||
| O result, OutS result_last, Comp comp = {}, Proj1 proj1 = {}, | ||
| Proj2 proj2 = {}); // freestanding-deleted | ||
| template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R1, @\exposconcept{sized-random-access-range}@ R2, | ||
| @\exposconcept{sized-random-access-range}@ OutR, class Comp = ranges::less, | ||
| class Proj1 = identity, class Proj2 = identity> | ||
| requires @\libconcept{mergeable}@<iterator_t<R1>, iterator_t<R2>, iterator_t<OutR>, Comp, Proj1, Proj2> | ||
| set_difference_result<borrowed_iterator_t<R1>, borrowed_iterator_t<OutR>> | ||
| set_difference_truncated_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, | ||
| borrowed_iterator_t<OutR>> | ||
| set_difference(Ep&& exec, R1&& r1, R2&& r2, OutR&& result_r, Comp comp = {}, | ||
| Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted | ||
| } | ||
|
|
@@ -10584,9 +10587,10 @@ | |
| If, of those elements, $k$ elements from the first range | ||
| are copied to the output range, | ||
| then the first $k$ elements from the second range | ||
| are considered \term{skipped}. | ||
| If $N < M$, a non-copied element is also considered skipped | ||
| if it compares less than the $(N + 1)^\text{th}$ element | ||
| \indextext{element!skipped}% | ||
| are considered \defn{skipped}. | ||
| A non-copied element is also considered skipped | ||
| if it compares less than the $\min(M, N + 1)^\text{th}$ element | ||
| of the sorted intersection. | ||
| Copies the first $N$ elements of the sorted intersection | ||
| to the range \range{result}{result + $N$}. | ||
|
|
@@ -10599,11 +10603,10 @@ | |
| for the overloads in namespace \tcode{std}. | ||
| \item | ||
| \tcode{\{last1, last2, result + $N$\}} | ||
| for the overloads in namespace \tcode{ranges}, | ||
| if $N$ is equal to $M$. | ||
| for the non-parallel algorithm overloads in namespace \tcode{ranges}. | ||
| \item | ||
| Otherwise, \tcode{\{first1 + $A$, first2 + $B$, result_last\}} | ||
| for the overloads in namespace \tcode{ranges}, | ||
| Otherwise, \tcode{\{first1 + $A$, first2 + $B$, result + $N$\}} | ||
| for the parallel algorithm overloads in namespace \tcode{ranges}, | ||
| where $A$ and $B$ are the numbers of copied or skipped elements | ||
| in \range{first1}{last1} and \range{first2}{last2}, respectively. | ||
| \end{itemize} | ||
|
|
@@ -10669,15 +10672,16 @@ | |
| @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@<O> OutS, class Comp = ranges::less, | ||
| class Proj1 = identity, class Proj2 = identity> | ||
| requires @\libconcept{mergeable}@<I1, I2, O, Comp, Proj1, Proj2> | ||
| ranges::set_difference_result<I1, O> | ||
| ranges::set_difference_truncated_result<I1, I2, O> | ||
| ranges::set_difference(Ep&& exec, I1 first1, S1 last1, | ||
| I2 first2, S2 last2, O result, OutS result_last, | ||
| Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); | ||
| template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R1, @\exposconcept{sized-random-access-range}@ R2, | ||
| @\exposconcept{sized-random-access-range}@ OutR, class Comp = ranges::less, | ||
| class Proj1 = identity, class Proj2 = identity> | ||
| requires @\libconcept{mergeable}@<iterator_t<R1>, iterator_t<R2>, iterator_t<OutR>, Comp, Proj1, Proj2> | ||
| ranges::set_difference_result<borrowed_iterator_t<R1>, borrowed_iterator_t<OutR>> | ||
| ranges::set_difference_truncated_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, | ||
| borrowed_iterator_t<OutR>> | ||
| ranges::set_difference(Ep&& exec, R1&& r1, R2&& r2, OutR&& result_r, Comp comp = {}, | ||
| Proj1 proj1 = {}, Proj2 proj2 = {}); | ||
| \end{itemdecl} | ||
|
|
@@ -10716,6 +10720,13 @@ | |
| that are equivalent to them, | ||
| the last $\max(m - n, 0)$ elements from \range{first1}{last1} | ||
| are included in the sorted difference, in order. | ||
| Of those equivalent elements, | ||
| the first $\min(m, n)$ elements in both ranges | ||
| \indextext{element!skipped}% | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question here, do we need to index this? |
||
| are considered \defn{skipped}. | ||
| An element from the second range is also considered skipped | ||
| if it compares less than the $\min(N + 1, M)^\text{th}$ element | ||
| of the sorted difference. | ||
| Copies the first $N$ elements of the sorted difference | ||
| to the range \range{result}{result + $N$}. | ||
|
|
||
|
|
@@ -10727,14 +10738,19 @@ | |
| for the overloads in namespace \tcode{std}. | ||
| \item | ||
| \tcode{\{last1, result + $N$\}} | ||
| for the overloads in namespace \tcode{ranges}, | ||
| if $N$ is equal to $M$. | ||
| for the non-parallel overloads in namespace \tcode{ranges}. | ||
| \item | ||
| Otherwise, \tcode{\{j1, result_last\}} | ||
| for the overloads in namespace \tcode{ranges}, | ||
| where the iterator \tcode{j1} | ||
| points to the position of the element in \range{first1}{last1} | ||
| corresponding to the $(N + 1)^\text{th}$ element of the sorted difference. | ||
| For the parallel algorithm overloads in namespace \tcode{ranges}: | ||
| \begin{itemize} | ||
| \item | ||
| \tcode{\{last1, first2 + $B$, result + $N$\}}, | ||
| if $N$ is equal to $M$, | ||
| where $B$ is the number of skipped elements in \range{first2}{last2}. | ||
| \item | ||
| Otherwise, \tcode{\{first1 + $A$, first2 + $B$, result_last\}}, | ||
| where $A$ and $B$ are the numbers of copied or skipped elements | ||
| in \range{first1}{last1} and \range{first2}{last2}, respectively. | ||
| \end{itemize} | ||
| \end{itemize} | ||
|
|
||
| \pnum | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7980,9 +7980,15 @@ | |
| The maximum hard limit shall be no larger than | ||
| \tcode{std::allocator_traits<Allocator>::max_size()}. | ||
| \item | ||
| If user-specified limits are not within hard limits, or | ||
| If user-specified limits passed to | ||
| a \tcode{hive} constructor or \tcode{reshape} | ||
| are not within hard limits, or | ||
| if the specified minimum limit is greater than the specified maximum limit, | ||
| the behavior is undefined. | ||
| the behavior is erroneous and the effects are | ||
| \impldef{effects of invalid \tcode{hive} limits}. | ||
| \begin{tailnote} | ||
| This condition can be checked using \tcode{is_within_hard_limits}. | ||
| \end{tailnote} | ||
| \item | ||
| An element block is said to be \defnx{within the bounds}{element block!bounds} | ||
| of a pair of minimum/maximum limits | ||
|
|
@@ -8089,6 +8095,7 @@ | |
| constexpr hive_limits block_capacity_limits() const noexcept; | ||
| static constexpr hive_limits block_capacity_default_limits() noexcept; | ||
| static constexpr hive_limits block_capacity_hard_limits() noexcept; | ||
| static constexpr bool is_within_hard_limits(hive_limits) noexcept; | ||
| void reshape(hive_limits block_limits); | ||
|
|
||
| // \ref{hive.modifiers}, modifiers | ||
|
|
@@ -8478,7 +8485,9 @@ | |
|
|
||
| \pnum | ||
| \throws | ||
| \tcode{length_error} if \tcode{n > max_size()}, | ||
| \tcode{length_error} if | ||
| satisfying the postcondition | ||
| would cause \tcode{capacity()} to exceed \tcode{max_size()}, | ||
| as well as any exceptions thrown by the allocator. | ||
|
|
||
| \pnum | ||
|
|
@@ -8604,6 +8613,20 @@ | |
| Constant. | ||
| \end{itemdescr} | ||
|
|
||
| \indexlibrarymember{is_within_hard_limits}{hive}% | ||
| \begin{itemdecl} | ||
| static constexpr bool is_within_hard_limits(hive_limits lim) noexcept; | ||
| \end{itemdecl} | ||
|
|
||
| \begin{itemdescr} | ||
| \pnum | ||
| Let \tcode{hl} be \tcode{block_capacity_hard_limits()}. | ||
|
|
||
| \pnum | ||
| \returns | ||
| \tcode{hl.min <= lim.min \&\& lim.min <= lim.max \&\& lim.max <= hl.max}. | ||
| \end{itemdescr} | ||
|
|
||
| \indexlibrarymember{reshape}{hive}% | ||
| \begin{itemdecl} | ||
| void reshape(hive_limits block_limits); | ||
|
|
@@ -10999,8 +11022,13 @@ | |
|
|
||
| friend constexpr bool operator==(const inplace_vector& x, | ||
| const inplace_vector& y); | ||
| friend constexpr @\exposid{synth-three-way-result}@<T> | ||
| operator<=>(const inplace_vector& x, const inplace_vector& y); | ||
| friend constexpr auto | ||
| operator<=>(const inplace_vector& x, const inplace_vector& y) | ||
| requires requires (const T t) { @\exposid{synth-three-way}@(t, t); } | ||
| { | ||
| return lexicographical_compare_three_way(x.begin(), x.end(), y.begin(), y.end(), | ||
| @\exposid{synth-three-way}@); | ||
| } | ||
| friend constexpr void swap(inplace_vector& x, inplace_vector& y) | ||
| noexcept(N == 0 || (is_nothrow_swappable_v<T> && | ||
| is_nothrow_move_constructible_v<T>)) | ||
|
|
@@ -11418,6 +11446,26 @@ | |
| equal to the number of elements after the erased elements. | ||
| \end{itemdescr} | ||
|
|
||
| \indexlibrarymember{swap}{inplace_vector}% | ||
| \begin{itemdecl} | ||
| constexpr void swap(inplace_vector& x) noexcept( | ||
| N == 0 || (is_nothrow_swappable_v<T> && is_nothrow_move_constructible_v<T>)); | ||
| \end{itemdecl} | ||
|
|
||
| \begin{itemdescr} | ||
| \pnum | ||
| \expects | ||
| \tcode{T} meets the \oldconcept{MoveConstructible} requirements. | ||
| Let $M$ be \tcode{min(size(), x.size())}. | ||
| For each non-negative integer $n < M$, | ||
| \tcode{(*this)[$n$]} is swappable | ||
| with \tcode{x[$n$]}\iref{swappable.requirements}. | ||
|
|
||
| \pnum | ||
| \effects | ||
| Exchanges the contents of \tcode{*this} and \tcode{x}. | ||
| \end{itemdescr} | ||
|
|
||
| \rSec3[inplace.vector.erasure]{Erasure} | ||
|
|
||
| \indexlibrarymember{erase}{inplace_vector}% | ||
|
|
@@ -11472,24 +11520,25 @@ | |
| template<class InputIterator> | ||
| using @\placeholder{iter-value-type}@ = iterator_traits<InputIterator>::value_type; // \expos | ||
| template<class InputIterator> | ||
| using @\placeholder{iter-key-type}@ = remove_const_t< | ||
| using @\placeholder{iter-key-type}@ = remove_cvref_t< | ||
| tuple_element_t<0, @\exposid{iter-value-type}@<InputIterator>>>; // \expos | ||
| template<class InputIterator> | ||
| using @\placeholder{iter-mapped-type}@ = | ||
| tuple_element_t<1, @\exposid{iter-value-type}@<InputIterator>>; // \expos | ||
| using @\placeholder{iter-mapped-type}@ = remove_cvref_t< | ||
| tuple_element_t<1, @\exposid{iter-value-type}@<InputIterator>>>; // \expos | ||
| template<class InputIterator> | ||
| using @\placeholder{iter-to-alloc-type}@ = pair< | ||
| const tuple_element_t<0, @\exposid{iter-value-type}@<InputIterator>>, | ||
| tuple_element_t<1, @\exposid{iter-value-type}@<InputIterator>>>; // \expos | ||
| const @\exposid{iter-key-type}@<InputIterator>, | ||
| @\exposid{iter-mapped-type}@<InputIterator>>; // \expos | ||
| template<ranges::@\libconcept{input_range}@ Range> | ||
| using @\exposid{range-key-type}@ = | ||
| remove_const_t<typename ranges::range_value_t<Range>::first_type>; // \expos | ||
| remove_cvref_t<tuple_element_t<0, ranges::range_value_t<Range>>>; // \expos | ||
| template<ranges::@\libconcept{input_range}@ Range> | ||
| using @\exposid{range-mapped-type}@ = ranges::range_value_t<Range>::second_type; // \expos | ||
| using @\exposid{range-mapped-type}@ = | ||
| remove_cvref_t<tuple_element_t<1, ranges::range_value_t<Range>>>; // \expos | ||
| template<ranges::@\libconcept{input_range}@ Range> | ||
| using @\exposid{range-to-alloc-type}@ = | ||
| pair<const typename ranges::range_value_t<Range>::first_type, | ||
| typename ranges::range_value_t<Range>::second_type>; // \expos | ||
| pair<const @\exposid{range-key-type}@<Range>, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. N.B. The P/R in the issue shows
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! |
||
| @\exposid{range-mapped-type}@<Range>>; // \expos | ||
| \end{codeblock} | ||
|
|
||
| \rSec2[associative.map.syn]{Header \tcode{<map>} synopsis} | ||
|
|
@@ -21486,7 +21535,7 @@ | |
| If \tcode{remove_cvref_t<OtherIndexType>} is an integral type other than \tcode{bool}, | ||
| then equivalent to \tcode{return i;}, | ||
| \item | ||
| otherwise, equivalent to \tcode{return static_cast<index_type>(i);}. | ||
| otherwise, equivalent to \tcode{return static_cast<index_type>(std::forward<OtherIndexType>(\brk{}i));}. | ||
| \end{itemize} | ||
| \begin{note} | ||
| This function will always return an integral type other than \tcode{bool}. | ||
|
|
@@ -22433,7 +22482,7 @@ | |
| is \tcode{true}. | ||
| Equivalent to: | ||
| \begin{codeblock} | ||
| return ((static_cast<index_type>(i) * stride(P)) + ... + 0); | ||
| return ((static_cast<index_type>(std::move(i)) * stride(P)) + ... + 0); | ||
| \end{codeblock} | ||
| \end{itemdescr} | ||
|
|
||
|
|
@@ -22766,7 +22815,7 @@ | |
| \end{codeblock} | ||
| is \tcode{true}. Equivalent to: | ||
| \begin{codeblock} | ||
| return ((static_cast<index_type>(i) * stride(P)) + ... + 0); | ||
| return ((static_cast<index_type>(std::move(i)) * stride(P)) + ... + 0); | ||
| \end{codeblock} | ||
| \end{itemdescr} | ||
|
|
||
|
|
@@ -23130,7 +23179,7 @@ | |
| is \tcode{true}. | ||
| Equivalent to: | ||
| \begin{codeblock} | ||
| return ((static_cast<index_type>(i) * stride(P)) + ... + 0); | ||
| return ((static_cast<index_type>(std::move(i)) * stride(P)) + ... + 0); | ||
| \end{codeblock} | ||
| \end{itemdescr} | ||
|
|
||
|
|
@@ -23445,10 +23494,14 @@ | |
| \indexlibraryctor{layout_left_padded::mapping}% | ||
| \begin{itemdecl} | ||
| template<class OtherIndexType> | ||
| constexpr mapping(const extents_type& ext, OtherIndexType pad); | ||
| constexpr mapping(const extents_type& ext, OtherIndexType padding); | ||
| \end{itemdecl} | ||
|
|
||
| \begin{itemdescr} | ||
| \pnum | ||
| Let \tcode{pad} be | ||
| \tcode{extents_type::\exposid{index-cast}(std::move(padding))}. | ||
|
|
||
| \pnum | ||
| \constraints | ||
| \begin{itemize} | ||
|
|
@@ -23464,7 +23517,7 @@ | |
| \item | ||
| \tcode{pad} is representable as a value of type \tcode{index_type}. | ||
| \item | ||
| \tcode{extents_type::\exposid{index-cast}(pad)} is greater than zero. | ||
| \tcode{pad} is greater than zero. | ||
| \item | ||
| If \exposid{rank_} is greater than one, | ||
| then \tcode{\exposid{LEAST-MULTIPLE-AT-LEAST}(pad, ext.extent(0))} | ||
|
|
@@ -23478,7 +23531,7 @@ | |
| is representable as a value of type \tcode{index_type}. | ||
| \item | ||
| If \tcode{padding_value} is not equal to \tcode{dynamic_extent}, | ||
| \tcode{padding_value} equals \tcode{extents_type::\exposid{in\-dex-cast}(pad)}. | ||
| \tcode{padding_value} equals \tcode{pad}. | ||
| \end{itemize} | ||
|
|
||
| \pnum | ||
|
|
@@ -23755,7 +23808,7 @@ | |
|
|
||
| \pnum | ||
| \returns | ||
| \tcode{((static_cast<index_type>(idxs) * stride(P_rank)) + ... + 0)}. | ||
| \tcode{((static_cast<index_type>(std::move(idxs)) * stride(P_rank)) + ... + 0)}. | ||
| \end{itemdescr} | ||
|
|
||
| \begin{itemdecl} | ||
|
|
@@ -24082,10 +24135,14 @@ | |
| \indexlibraryctor{layout_right_padded::mapping}% | ||
| \begin{itemdecl} | ||
| template<class OtherIndexType> | ||
| constexpr mapping(const extents_type& ext, OtherIndexType pad); | ||
| constexpr mapping(const extents_type& ext, OtherIndexType padding); | ||
| \end{itemdecl} | ||
|
|
||
| \begin{itemdescr} | ||
| \pnum | ||
| Let \tcode{pad} be | ||
| \tcode{extents_type::\exposid{index-cast}(std::move(padding))}. | ||
|
|
||
| \pnum | ||
| \constraints | ||
| \begin{itemize} | ||
|
|
@@ -24101,7 +24158,7 @@ | |
| \item | ||
| \tcode{pad} is representable as a value of type \tcode{index_type}. | ||
| \item | ||
| \tcode{extents_type::\exposid{index-cast}(pad)} is greater than zero. | ||
| \tcode{pad} is greater than zero. | ||
| \item | ||
| If \exposid{rank_} is greater than one, | ||
| then \tcode{\exposid{LEAST-MULTIPLE-AT-LEAST}(pad, ext.extent(\exposid{rank_} - 1))} | ||
|
|
@@ -24115,7 +24172,7 @@ | |
| is representable as a value of type \tcode{index_type}. | ||
| \item | ||
| If \tcode{padding_value} is not equal to \tcode{dynamic_extent}, | ||
| \tcode{padding_value} equals \tcode{extents_type::\linebreak \exposid{index-cast}(pad)}. | ||
| \tcode{padding_value} equals \tcode{pad}. | ||
| \end{itemize} | ||
|
|
||
| \pnum | ||
|
|
@@ -24390,7 +24447,7 @@ | |
|
|
||
| \pnum | ||
| \returns | ||
| \tcode{((static_cast<index_type>(idxs) * stride(P_rank)) + ... + 0)}. | ||
| \tcode{((static_cast<index_type>(std::move(idxs)) * stride(P_rank)) + ... + 0)}. | ||
| \end{itemdescr} | ||
|
|
||
| \indexlibrarymember{layout_right_padded::mapping}{is_always_exhaustive}% | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definition is local to this function, do we need to index it?