Skip to content

Commit 90427a0

Browse files
authored
Merge 2025-11 LWG Motion 19
P3923R0 Additional NB comment resolutions for Kona 2025
2 parents c80c273 + 7963a15 commit 90427a0

File tree

5 files changed

+158
-91
lines changed

5 files changed

+158
-91
lines changed

source/algorithms.tex

Lines changed: 72 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -10445,8 +10445,7 @@
1044510445
and \tcode{proj1} and \tcode{proj2} be \tcode{identity\{\}}
1044610446
for the overloads with no parameters by those names;
1044710447
\item
10448-
$M$ be \tcode{last1 - first1} plus the number of elements in \range{first2}{last2}
10449-
that are not present in \range{first1}{last1};
10448+
$M$ be the number of elements in the sorted union (see below);
1045010449
\item
1045110450
\tcode{result_last} be \tcode{result + $M$}
1045210451
for the overloads with no parameter \tcode{result_last} or \tcode{result_r};
@@ -10462,8 +10461,21 @@
1046210461

1046310462
\pnum
1046410463
\effects
10465-
Constructs a sorted union of $N$ elements from the two ranges;
10464+
Constructs a sorted union of the elements from the two ranges;
1046610465
that is, the set of elements that are present in one or both of the ranges.
10466+
If \range{first1}{last1} contains $m$ elements
10467+
that are equivalent to each other and
10468+
\range{first2}{last2} contains $n$ elements that are equivalent to them,
10469+
then all $m$ elements from the first range
10470+
are included in the union, in order, and
10471+
then the final $\max(n - m, 0)$ elements from the second range
10472+
are included in the union, in order.
10473+
If, of those elements, $k$ elements from the first range
10474+
are copied to the output range,
10475+
then the first $\min(k, n)$ elements from the second range
10476+
are considered \term{skipped}.
10477+
Copies the first $N$ elements of the sorted union
10478+
to the range \range{result}{result + $N$}.
1046710479

1046810480
\pnum
1046910481
\returns
@@ -10476,10 +10488,9 @@
1047610488
for the overloads in namespace \tcode{ranges},
1047710489
if $N$ is equal to $M$.
1047810490
\item
10479-
Otherwise, \tcode{\{j1, j2, result_last\}}
10491+
Otherwise, \tcode{\{first1 + $A$, first2 + $B$, result_last\}}
1048010492
for the overloads in namespace \tcode{ranges},
10481-
where the iterators \tcode{j1} and \tcode{j2}
10482-
point to positions past the last copied or skipped elements
10493+
where $A$ and $B$ are the numbers of copied or skipped elements
1048310494
in \range{first1}{last1} and \range{first2}{last2}, respectively.
1048410495
\end{itemize}
1048510496

@@ -10491,14 +10502,6 @@
1049110502
\pnum
1049210503
\remarks
1049310504
Stable\iref{algorithm.stable}.
10494-
If \range{first1}{last1} contains $m$ elements
10495-
that are equivalent to each other and
10496-
\range{first2}{last2} contains $n$ elements
10497-
that are equivalent to them,
10498-
then all $m$ elements from the first range
10499-
are copied to the output range, in order, and
10500-
then the final $\max(n - m, 0)$ elements from the second range
10501-
are copied to the output range, in order.
1050210505
\end{itemdescr}
1050310506

1050410507
\rSec3[set.intersection]{\tcode{set_intersection}}
@@ -10575,8 +10578,7 @@
1057510578
and \tcode{proj1} and \tcode{proj2} be \tcode{identity\{\}}
1057610579
for the overloads with no parameters by those names;
1057710580
\item
10578-
$M$ be the number of elements in \range{first1}{last1}
10579-
that are present in \range{first2}{last2};
10581+
$M$ be the number of elements in the sorted intersection (see below);
1058010582
\item
1058110583
\tcode{result_last} be \tcode{result + $M$}
1058210584
for the overloads with no parameter \tcode{result_last} or \tcode{result_r};
@@ -10592,8 +10594,23 @@
1059210594

1059310595
\pnum
1059410596
\effects
10595-
Constructs a sorted intersection of $N$ elements from the two ranges;
10597+
Constructs a sorted intersection of the elements from the two ranges;
1059610598
that is, the set of elements that are present in both of the ranges.
10599+
If \range{first1}{last1} contains $m$ elements
10600+
that are equivalent to each other and
10601+
\range{first2}{last2} contains $n$ elements
10602+
that are equivalent to them,
10603+
the first $\min(m, n)$ elements from the first range
10604+
are included in the sorted intersection.
10605+
If, of those elements, $k$ elements from the first range
10606+
are copied to the output range,
10607+
then the first $k$ elements from the second range
10608+
are considered \term{skipped}.
10609+
If $N < M$, a non-copied element is also considered skipped
10610+
if it compares less than the $(N + 1)^\text{th}$ element
10611+
of the sorted intersection.
10612+
Copies the first $N$ elements of the sorted intersection
10613+
to the range \range{result}{result + $N$}.
1059710614

1059810615
\pnum
1059910616
\returns
@@ -10606,10 +10623,9 @@
1060610623
for the overloads in namespace \tcode{ranges},
1060710624
if $N$ is equal to $M$.
1060810625
\item
10609-
Otherwise, \tcode{\{j1, j2, result_last\}}
10626+
Otherwise, \tcode{\{first1 + $A$, first2 + $B$, result_last\}}
1061010627
for the overloads in namespace \tcode{ranges},
10611-
where the iterators \tcode{j1} and \tcode{j2}
10612-
point to positions past the last copied or skipped elements
10628+
where $A$ and $B$ are the numbers of copied or skipped elements
1061310629
in \range{first1}{last1} and \range{first2}{last2}, respectively.
1061410630
\end{itemize}
1061510631

@@ -10621,12 +10637,6 @@
1062110637
\pnum
1062210638
\remarks
1062310639
Stable\iref{algorithm.stable}.
10624-
If \range{first1}{last1} contains $m$ elements
10625-
that are equivalent to each other and
10626-
\range{first2}{last2} contains $n$ elements
10627-
that are equivalent to them,
10628-
the first $\min(m, n)$ elements
10629-
are copied from the first range to the output range, in order.
1063010640
\end{itemdescr}
1063110641

1063210642
\rSec3[set.difference]{\tcode{set_difference}}
@@ -10702,8 +10712,7 @@
1070210712
and \tcode{proj1} and \tcode{proj2} be \tcode{identity\{\}}
1070310713
for the overloads with no parameters by those names;
1070410714
\item
10705-
$M$ be the number of elements in \range{first1}{last1}
10706-
that are not present in \range{first2}{last2};
10715+
$M$ be the number of elements in the sorted difference (see below);
1070710716
\item
1070810717
\tcode{result_last} be \tcode{result + $M$}
1070910718
for the overloads with no parameter \tcode{result_last} or \tcode{result_r};
@@ -10719,10 +10728,17 @@
1071910728

1072010729
\pnum
1072110730
\effects
10722-
Copies $N$ elements of the range \range{first1}{last1}
10723-
which are not present in the range \range{first2}{last2}
10731+
Constructs a sorted difference between the elements from the two ranges;
10732+
that is, the set of elements that are present
10733+
in the range \range{first1}{last1} but not \range{first2}{last2}.
10734+
If \range{first1}{last1} contains $m$ elements
10735+
that are equivalent to each other and
10736+
\range{first2}{last2} contains $n$ elements
10737+
that are equivalent to them,
10738+
the last $\max(m - n, 0)$ elements from \range{first1}{last1}
10739+
are included in the sorted difference, in order.
10740+
Copies the first $N$ elements of the sorted difference
1072410741
to the range \range{result}{result + $N$}.
10725-
The elements in the constructed range are sorted.
1072610742

1072710743
\pnum
1072810744
\returns
@@ -10738,8 +10754,8 @@
1073810754
Otherwise, \tcode{\{j1, result_last\}}
1073910755
for the overloads in namespace \tcode{ranges},
1074010756
where the iterator \tcode{j1}
10741-
points to the position past the last copied or skipped element
10742-
in \range{first1}{last1}.
10757+
points to the position of the element in \range{first1}{last1}
10758+
corresponding to the $(N + 1)^\text{th}$ element of the sorted difference.
1074310759
\end{itemize}
1074410760

1074510761
\pnum
@@ -10749,12 +10765,7 @@
1074910765

1075010766
\pnum
1075110767
\remarks
10752-
If \range{first1}{last1} contains $m$ elements
10753-
that are equivalent to each other and
10754-
\range{first2}{last2} contains $n$ elements
10755-
that are equivalent to them,
10756-
the last $\max(m - n, 0)$ elements from \range{first1}{last1}
10757-
are copied to the output range, in order.
10768+
Stable\iref{algorithm.stable}.
1075810769
\end{itemdescr}
1075910770

1076010771
\rSec3[set.symmetric.difference]{\tcode{set_symmetric_difference}}
@@ -10833,14 +10844,12 @@
1083310844
and \tcode{proj1} and \tcode{proj2} be \tcode{identity\{\}}
1083410845
for the overloads with no parameters by those names;
1083510846
\item
10836-
$K$ be the number of elements in \range{first1}{last1} that are not present in \range{first2}{last2}.
10837-
\item
10838-
$M$ be the number of elements in \range{first2}{last2} that are not present in \range{first1}{last1}.
10847+
$M$ be the number of elements in the sorted symmetric difference (see below);
1083910848
\item
10840-
\tcode{result_last} be \tcode{result + $M$ + $K$}
10849+
\tcode{result_last} be \tcode{result + $M$}
1084110850
for the overloads with no parameter \tcode{result_last} or \tcode{result_r};
1084210851
\item
10843-
$N$ be $\min(K + M, \ \tcode{result_last - result})$.
10852+
$N$ be $\min(M, \ \tcode{result_last - result})$.
1084410853
\end{itemize}
1084510854

1084610855
\pnum
@@ -10851,12 +10860,24 @@
1085110860

1085210861
\pnum
1085310862
\effects
10854-
Copies the elements of the range \range{first1}{last1}
10855-
that are not present in the range \range{first2}{last2},
10856-
and the elements of the range \range{first2}{last2}
10857-
that are not present in the range \range{first1}{last1}
10863+
Constructs a sorted symmetric difference of the elements from the two ranges;
10864+
that is, the set of elements that are present
10865+
in exactly one of \range{first1}{last1} and \range{first2}{last2}.
10866+
If \range{first1}{last1} contains $m$ elements
10867+
that are equivalent to each other and
10868+
\range{first2}{last2} contains $n$ elements
10869+
that are equivalent to them,
10870+
then $|m - n|$ of those elements are included in the symmetric difference:
10871+
the last $m - n$ of these elements from \range{first1}{last1},
10872+
in order, if $m > n$, and
10873+
the last $n - m$ of these elements from \range{first2}{last2},
10874+
in order, if $m < n$.
10875+
If $N < M$, a non-copied element is considered \term{skipped}
10876+
if it compares less than or equivalent to the $(N + 1)^\text{th}$ element
10877+
of the sorted symmetric difference,
10878+
unless it is from the same range as that element and does not precede it.
10879+
Copies the first $N$ elements of the sorted symmetric difference
1085810880
to the range \range{result}{result + $N$}.
10859-
The elements in the constructed range are sorted.
1086010881

1086110882
\pnum
1086210883
\returns
@@ -10869,10 +10890,9 @@
1086910890
for the overloads in namespace \tcode{ranges},
1087010891
if $N$ is equal to $M + K$.
1087110892
\item
10872-
Otherwise, \tcode{\{j1, j2, result_last\}}
10893+
Otherwise, \tcode{\{first1 + $A$, first2 + $B$, result_last\}}
1087310894
for the overloads in namespace \tcode{ranges},
10874-
where the iterators \tcode{j1} and \tcode{j2}
10875-
point to positions past the last copied or skipped elements
10895+
where $A$ and $B$ are the numbers of copied or skipped elements
1087610896
in \range{first1}{last1} and \range{first2}{last2}, respectively.
1087710897
\end{itemize}
1087810898

@@ -10884,14 +10904,6 @@
1088410904
\pnum
1088510905
\remarks
1088610906
Stable\iref{algorithm.stable}.
10887-
If \range{first1}{last1} contains $m$ elements
10888-
that are equivalent to each other and
10889-
\range{first2}{last2} contains $n$ elements
10890-
that are equivalent to them,
10891-
then $|m - n|$ of those elements shall be copied to the output range:
10892-
the last $m - n$ of these elements from \range{first1}{last1} if $m > n$, and
10893-
the last $n - m$ of these elements from \range{first2}{last2} if $m < n$.
10894-
In either case, the elements are copied in order.
1089510907
\end{itemdescr}
1089610908

1089710909
\rSec2[alg.heap.operations]{Heap operations}

source/containers.tex

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7930,8 +7930,11 @@
79307930
that provides constant-time insertion and erasure operations.
79317931
Storage is automatically managed in multiple memory blocks,
79327932
referred to as \defnx{element blocks}{element block}.
7933-
Insertion position is determined by the container, and insertion
7933+
Insertion\iref{hive.modifiers} position is determined by the container, and insertion
79347934
may re-use the memory locations of erased elements.
7935+
\begin{note}
7936+
Construction and assignment are not considered to involve insertion operations.
7937+
\end{note}
79357938

79367939
\pnum
79377940
Element blocks which contain elements are referred to
@@ -8253,7 +8256,7 @@
82538256
\begin{itemdescr}
82548257
\pnum
82558258
\effects
8256-
Constructs a \tcode{hive} object with the elements of the range \tcode{rg},
8259+
Constructs a \tcode{hive} object equal to the range \tcode{rg},
82578260
using the specified allocator.
82588261
If the second overload is called,
82598262
also initializes \exposid{current-limits} with \tcode{block_limits}.
@@ -8276,7 +8279,7 @@
82768279

82778280
\pnum
82788281
\effects
8279-
Constructs a \tcode{hive} object with the elements of \tcode{x}.
8282+
Constructs a \tcode{hive} object equal to \tcode{x}.
82808283
If the second overload is called, uses \tcode{alloc}.
82818284
Initializes \exposid{current-limits} with \tcode{x.\exposid{current-limits}}.
82828285

@@ -8319,6 +8322,8 @@
83198322
\pnum
83208323
\ensures
83218324
\tcode{x.empty()} is \tcode{true}.
8325+
The relative order of the elements of \tcode{*this}
8326+
is the same as that of the elements of \tcode{x} prior to the call.
83228327

83238328
\pnum
83248329
\complexity
@@ -8340,7 +8345,7 @@
83408345

83418346
\pnum
83428347
\effects
8343-
Constructs a \tcode{hive} object with the elements of \tcode{il},
8348+
Constructs a \tcode{hive} object equal to \tcode{il},
83448349
using the specified allocator.
83458350
If the second overload is called,
83468351
also initializes \exposid{current-limits} with \tcode{block_limits}.
@@ -8364,7 +8369,8 @@
83648369
\pnum
83658370
\effects
83668371
All elements in \tcode{*this} are either copy-assigned to, or destroyed.
8367-
All elements in \tcode{x} are copied into \tcode{*this}.
8372+
All elements in \tcode{x} are copied into \tcode{*this},
8373+
maintaining their relative order.
83688374
\begin{note}
83698375
\exposid{current-limits} is unchanged.
83708376
\end{note}
@@ -8423,6 +8429,8 @@
84238429
\pnum
84248430
\ensures
84258431
\tcode{x.empty()} is \tcode{true}.
8432+
The relative order of the elements of \tcode{*this}
8433+
is the same as that of the elements of \tcode{x} prior to this call.
84268434

84278435
\pnum
84288436
\complexity
@@ -8479,7 +8487,6 @@
84798487

84808488
\pnum
84818489
\remarks
8482-
The size of the sequence is not changed.
84838490
All references, pointers, and iterators referring to elements in \tcode{*this},
84848491
as well as the past-the-end iterator, remain valid.
84858492
\end{itemdescr}
@@ -8533,7 +8540,10 @@
85338540
\effects
85348541
For the first overload, all reserved blocks are deallocated, and
85358542
\tcode{capacity()} is reduced accordingly.
8536-
For the second overload, \tcode{capacity()} is reduced to no less than \tcode{n}.
8543+
For the second overload,
8544+
if \tcode{n >= capacity()} is \tcode{true},
8545+
there are no effects;
8546+
otherwise, \tcode{capacity()} is reduced to no less than \tcode{n}.
85378547

85388548
\pnum
85398549
\complexity
@@ -8825,6 +8835,8 @@
88258835
\effects
88268836
If \tcode{addressof(x) == this} is \tcode{true},
88278837
the behavior is erroneous and there are no effects.
8838+
If an exceptions is thrown,
8839+
there are no effects.
88288840
Otherwise, inserts the contents of \tcode{x} into \tcode{*this} and
88298841
\tcode{x} becomes empty.
88308842
Pointers and references to the moved elements of \tcode{x}

0 commit comments

Comments
 (0)