You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let \tcode{binary_pred} be \tcode{equal_to<>\{\}} for the first overload.
4799
+
4800
+
\pnum
4801
+
\expects
4802
+
\tcode{binary_pred} is an equivalence relation.
4803
+
4791
4804
\pnum
4792
4805
\effects
4793
4806
Erases all but the first element from every consecutive
4794
-
group of equal elements referred to by the iterator \tcode{i} in the range \range{first +
4795
-
1}{last} for which \tcode{*i == *(i-1)} (for the version with no arguments) or \tcode{pred(*i,
4796
-
*(i - 1))} (for the version with a predicate argument) holds.
4807
+
group of equivalent elements.
4808
+
That is, for a nonempty list, erases all elements referred to
4809
+
by the iterator \tcode{i} in the range \range{begin() + 1}{end()}
4810
+
for which \tcode{binary_pred(*i, *(i - 1))} is \tcode{true}.
4797
4811
Invalidates only the iterators and references to the erased elements.
4798
4812
4799
4813
\pnum
@@ -4802,11 +4816,14 @@
4802
4816
4803
4817
\pnum
4804
4818
\throws
4805
-
Nothing unless an exception is thrown by the equality comparison or the predicate.
4819
+
Nothing unless an exception is thrown by the predicate.
4806
4820
4807
4821
\pnum
4808
4822
\complexity
4809
-
If the range \range{first}{last} is not empty, exactly \tcode{(last - first) - 1} applications of the corresponding predicate, otherwise no applications of the predicate.
4823
+
If \tcode{empty()} is \tcode{false},
4824
+
exactly \tcode{distance(begin(), end()) - 1} applications of
4825
+
the corresponding predicate,
4826
+
otherwise no applications of the predicate.
4810
4827
\end{itemdescr}
4811
4828
4812
4829
\indexlibrarymember{merge}{forward_list}%
@@ -5296,6 +5313,10 @@
5296
5313
arguments for a template parameter
5297
5314
named \tcode{Predicate} or \tcode{BinaryPredicate}
5298
5315
shall meet the corresponding requirements in \ref{algorithms.requirements}.
5316
+
The semantics of \tcode{i + n} and \tcode{i - n},
5317
+
where \tcode{i} is an iterator into the list and \tcode{n} is an integer,
5318
+
are the same as those of \tcode{next(i, n)} and \tcode{prev(i, n)},
5319
+
respectively.
5299
5320
For \tcode{merge} and \tcode{sort},
5300
5321
the definitions and requirements in \ref{alg.sorting} apply.
5301
5322
@@ -5474,13 +5495,20 @@
5474
5495
\end{itemdecl}
5475
5496
5476
5497
\begin{itemdescr}
5498
+
\pnum
5499
+
Let \tcode{binary_pred} be \tcode{equal_to<>\{\}} for the first overload.
5500
+
5501
+
\pnum
5502
+
\expects
5503
+
\tcode{binary_pred} is an equivalence relation.
5504
+
5477
5505
\pnum
5478
5506
\effects
5479
5507
Erases all but the first element from every
5480
-
consecutive group of equal elements referred to by the iterator \tcode{i} in the range
5481
-
\range{first + 1}{last} for which \tcode{*i == *(i-1)} (for the version of
5482
-
\tcode{unique} with no arguments) or \tcode{binary_pred(*i, *(i - 1))} (for the version of
5483
-
\tcode{unique} with a predicate argument) holds.
5508
+
consecutive group of equivalent elements.
5509
+
That is, for a nonempty list, erases all elements referred to
5510
+
by the iterator \tcode{i} in the range \range{begin() + 1}{end()}
5511
+
for which \tcode{binary_pred(*i, *(i - 1))} is \tcode{true}.
5484
5512
Invalidates only the iterators and references to the erased elements.
5485
5513
5486
5514
\pnum
@@ -5489,18 +5517,12 @@
5489
5517
5490
5518
\pnum
5491
5519
\throws
5492
-
Nothing unless an exception is thrown by
5493
-
\tcode{*i == *(i-1)}
5494
-
or
5495
-
\tcode{pred(*i, *(i - 1))}.
5520
+
Nothing unless an exception is thrown by the predicate.
5496
5521
5497
5522
\pnum
5498
5523
\complexity
5499
-
If the range
5500
-
\tcode{[first, last)}
5501
-
is not empty, exactly
5502
-
\tcode{(last - first) - 1}
5503
-
applications of the corresponding predicate,
5524
+
If \tcode{empty()} is \tcode{false},
5525
+
exactly \tcode{size() - 1} applications of the corresponding predicate,
5504
5526
otherwise no applications of the predicate.
5505
5527
\end{itemdescr}
5506
5528
@@ -9695,6 +9717,12 @@
9695
9717
exception is thrown by the swap of the adaptor's \tcode{Container} or
9696
9718
\tcode{Compare} object (if any).
9697
9719
9720
+
\pnum
9721
+
A constructor template of a container adaptor
9722
+
shall not participate in overload resolution
9723
+
if it has an \tcode{InputIterator} template parameter and
9724
+
a type that does not qualify as an input iterator is deduced for that parameter.
9725
+
9698
9726
\pnum
9699
9727
A deduction guide for a container adaptor shall not participate in overload resolution if any of the following are true:
9700
9728
\begin{itemize}
@@ -9705,6 +9733,11 @@
9705
9733
\item It has both \tcode{Container} and \tcode{Allocator} template parameters, and \tcode{uses_allocator_v<Container, Allocator>} is \tcode{false}.
9706
9734
\end{itemize}
9707
9735
9736
+
\pnum
9737
+
The exposition-only alias template \exposid{iter-value-type}
9738
+
defined in \ref{sequences.general}
9739
+
may appear in deduction guides for container adaptors.
0 commit comments