Skip to content

Commit db5e01e

Browse files
authored
Merge branch 'main' into patch-2
2 parents 0e2b1a6 + c2439d3 commit db5e01e

30 files changed

+5799
-1415
lines changed

source/algorithms.tex

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,13 @@
246246
return n;
247247
\end{codeblock}
248248

249+
\pnum
250+
In the description of the algorithms,
251+
given an iterator \tcode{a} whose difference type is \tcode{D}, and
252+
an expression \tcode{n} of integer-like type other than \cv{} \tcode{D},
253+
the semantics of \tcode{a + n} and \tcode{a - n} are, respectively,
254+
those of \tcode{a + D(n)} and \tcode{a - D(n)}.
255+
249256
\pnum
250257
In the description of algorithm return values,
251258
a sentinel value \tcode{s} denoting the end of a range \range{i}{s}
@@ -3939,17 +3946,24 @@
39393946

39403947
\pnum
39413948
\complexity
3942-
If the types of \tcode{first1}, \tcode{last1}, \tcode{first2}, and \tcode{last2}:
3949+
If
39433950
\begin{itemize}
39443951
\item
3952+
the types of \tcode{first1}, \tcode{last1}, \tcode{first2}, and \tcode{last2}
39453953
meet the
39463954
\oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators}
3955+
and \tcode{last1 - first1 != last2 - first2}
39473956
for the overloads in namespace \tcode{std};
39483957
\item
3949-
pairwise model \libconcept{sized_sentinel_for}\iref{iterator.concept.sizedsentinel}
3950-
for the overloads in namespace \tcode{ranges},
3958+
the types of \tcode{first1}, \tcode{last1}, \tcode{first2}, and \tcode{last2}
3959+
pairwise model \libconcept{sized_sentinel_for}\iref{iterator.concept.sizedsentinel}
3960+
and \tcode{last1 - first1 != last2 - first2}
3961+
for the first overload in namespace \tcode{ranges},
3962+
\item
3963+
\tcode{R1} and \tcode{R2} each model \libconcept{sized_range} and
3964+
\tcode{ranges::distance(r1) != ranges::distance(r2)}
3965+
for the second overload in namespace \tcode{ranges},
39513966
\end{itemize}
3952-
and \tcode{last1 - first1 != last2 - first2},
39533967
then no applications of the corresponding predicate and each projection;
39543968
otherwise,
39553969
\begin{itemize}
@@ -4054,9 +4068,17 @@
40544068
\complexity
40554069
No applications of the corresponding predicate and projections if:
40564070
\begin{itemize}
4071+
\item
4072+
for the first overload,
4073+
\begin{itemize}
40574074
\item \tcode{S1} and \tcode{I1} model \tcode{\libconcept{sized_sentinel_for}<S1, I1>},
40584075
\item \tcode{S2} and \tcode{I2} model \tcode{\libconcept{sized_sentinel_for}<S2, I2>}, and
4059-
\item \tcode{last1 - first1 != last2 - first2}.
4076+
\item \tcode{last1 - first1 != last2 - first2};
4077+
\end{itemize}
4078+
\item
4079+
for the second overload,
4080+
\tcode{R1} and \tcode{R2} each model \libconcept{sized_range}, and
4081+
\tcode{ranges::distance(r1) != ranges::distance(r2)}.
40604082
\end{itemize}
40614083
Otherwise, exactly \tcode{last1 - first1} applications
40624084
of the corresponding predicate and projections

source/basic.tex

Lines changed: 51 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,32 @@
865865
\end{itemize}
866866
\end{note}
867867

868+
\pnum
869+
Two non-static member functions have
870+
\defnadjx{corresponding}{object parameters}{object parameter} if:
871+
\begin{itemize}
872+
\item
873+
exactly one is an implicit object member function
874+
with no \grammarterm{ref-qualifier} and
875+
the types of their object parameters\iref{dcl.fct},
876+
after removing top-level references,
877+
are the same, or
878+
\item
879+
their object parameters have the same type.
880+
\end{itemize}
881+
Two non-static member function templates have
882+
\defnadjx{corresponding}{object parameters}{object parameter} if:
883+
\begin{itemize}
884+
\item
885+
exactly one is an implicit object member function
886+
with no \grammarterm{ref-qualifier} and
887+
the types of their object parameters,
888+
after removing any references,
889+
are equivalent, or
890+
\item
891+
the types of their object parameters are equivalent.
892+
\end{itemize}
893+
868894
\pnum
869895
Two declarations \defn{correspond}
870896
if they (re)introduce the same name,
@@ -885,25 +911,23 @@
885911
each declares a function or function template, except when
886912
\begin{itemize}
887913
\item
888-
both declare functions with the same parameter-type-list,
914+
both declare functions with the same non-object-parameter-type-list,
889915
\begin{footnote}
890916
An implicit object parameter\iref{over.match.funcs}
891917
is not part of the parameter-type-list.
892918
\end{footnote}
893919
equivalent\iref{temp.over.link} trailing \grammarterm{requires-clause}s
894920
(if any, except as specified in \ref{temp.friend}), and,
895921
if both are non-static members,
896-
the same \grammarterm{cv-qualifier}s (if any) and
897-
\grammarterm{ref-qualifier} (if both have one), or
922+
they have corresponding object parameters, or
898923
\item
899924
both declare function templates with equivalent
900-
parameter-type-lists,
925+
non-object-parameter-type-lists,
901926
return types (if any),
902927
\grammarterm{template-head}s, and
903928
trailing \grammarterm{requires-clause}s (if any), and,
904929
if both are non-static members,
905-
the same \grammarterm{cv-qualifier}s (if any) and
906-
\grammarterm{ref-qualifier} (if both have one).
930+
they have corresponding object parameters.
907931
\end{itemize}
908932
\end{itemize}
909933
\begin{note}
@@ -923,16 +947,23 @@
923947
\begin{codeblock}
924948
typedef int Int;
925949
enum E : int { a };
926-
void f(int); // \#1
927-
void f(Int) {} // defines \#1
928-
void f(E) {} // OK: another overload
950+
void f(int); // \#1
951+
void f(Int) {} // defines \#1
952+
void f(E) {} // OK: another overload
929953

930954
struct X {
931955
static void f();
932-
void f() const; // error: redeclaration
956+
void f() const; // error: redeclaration
933957
void g();
934-
void g() const; // OK
935-
void g() &; // error: redeclaration
958+
void g() const; // OK
959+
void g() &; // error: redeclaration
960+
961+
void h(this X&, int);
962+
void h(int) &&; // OK: another overload
963+
void j(this const X&);
964+
void j() const&; // error: redeclaration
965+
void k();
966+
void k(this X&); // error: redeclaration
936967
};
937968
\end{codeblock}
938969
\end{example}
@@ -2947,9 +2978,10 @@
29472978
\indextext{memory model|(}%
29482979
The fundamental storage unit in the \Cpp{} memory model is the
29492980
\defn{byte}.
2950-
A byte is at least large enough to contain any member of the basic
2951-
\indextext{character set!basic execution}%
2952-
execution character set\iref{lex.charset}
2981+
A byte is at least large enough to contain
2982+
the ordinary literal encoding of any element of the basic
2983+
\indextext{character set!basic literal}%
2984+
literal character set\iref{lex.charset}
29532985
and the eight-bit code units of the Unicode
29542986
\begin{footnote}
29552987
Unicode\textregistered\ is a registered trademark of Unicode, Inc.
@@ -4849,8 +4881,6 @@
48494881
Type \keyword{char} is a distinct type
48504882
that has an \impldef{underlying type of \tcode{char}} choice of
48514883
``\tcode{\keyword{signed} \keyword{char}}'' or ``\tcode{\keyword{unsigned} \keyword{char}}'' as its underlying type.
4852-
The values of type \keyword{char} can represent distinct codes
4853-
for all members of the implementation's basic character set.
48544884
The three types \keyword{char}, \tcode{\keyword{signed} \keyword{char}}, and \tcode{\keyword{unsigned} \keyword{char}}
48554885
are collectively called
48564886
\defnadjx{ordinary character}{types}{type}.
@@ -4911,10 +4941,10 @@
49114941

49124942
\pnum
49134943
\indextext{type!integral}%
4914-
Types
4915-
\keyword{bool},
4916-
\keyword{char}, \keyword{wchar_t},
4917-
\keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t}, and
4944+
The types \keyword{char}, \keyword{wchar_t},
4945+
\keyword{char8_t}, \keyword{char16_t}, and \keyword{char32_t}
4946+
are collectively called \defnadjx{character}{types}{type}.
4947+
The character types, \keyword{bool},
49184948
the signed and unsigned integer types,
49194949
and cv-qualified versions\iref{basic.type.qualifier} thereof,
49204950
are collectively termed

source/classes.tex

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -997,15 +997,15 @@
997997
\indextext{member function!volatile}%
998998
\indextext{member function!const volatile}%
999999
\begin{note}
1000-
A non-static member function can be declared with
1000+
An implicit object member function can be declared with
10011001
\grammarterm{cv-qualifier}{s}, which affect the type of the \keyword{this}
10021002
pointer\iref{expr.prim.this},
10031003
and/or a \grammarterm{ref-qualifier}\iref{dcl.fct};
10041004
both affect overload resolution\iref{over.match.funcs}
10051005
\end{note}
10061006

10071007
\pnum
1008-
A non-static member function may be declared
1008+
An implicit object member function may be declared
10091009
virtual\iref{class.virtual} or pure virtual\iref{class.abstract}.
10101010

10111011
\rSec2[special]{Special member functions}
@@ -1832,9 +1832,7 @@
18321832
The implicitly-declared copy/move assignment operator for class
18331833
\tcode{X}
18341834
has the return type
1835-
\tcode{X\&};
1836-
it returns the object for which the assignment operator is invoked, that is,
1837-
the object assigned to.
1835+
\tcode{X\&}.
18381836
An implicitly-declared copy/move assignment operator is an
18391837
inline public member of its class.
18401838

@@ -1996,6 +1994,11 @@
19961994
the object that is the source of the copy,
19971995
a corresponding object $o$ nested within the destination is created,
19981996
and the lifetime of $o$ begins before the copy is performed.
1997+
1998+
\pnum
1999+
The implicitly-defined copy/move assignment operator for a class
2000+
returns the object for which the assignment operator is invoked,
2001+
that is, the object assigned to.
19992002
\indextext{assignment operator!move|)}
20002003
\indextext{assignment operator!copy|)}
20012004

@@ -2484,7 +2487,7 @@
24842487
\nontermdef{conversion-declarator}\br
24852488
ptr-operator \opt{conversion-declarator}
24862489
\end{bnf}
2487-
shall have no parameters and
2490+
shall have no non-object parameters and
24882491
specifies a conversion from \tcode{X} to
24892492
the type specified by the \grammarterm{conversion-type-id},
24902493
interpreted as a \grammarterm{type-id}\iref{dcl.name}.
@@ -3723,6 +3726,10 @@
37233726
\end{codeblock}
37243727
\end{example}
37253728

3729+
\pnum
3730+
The \grammarterm{ref-qualifier}, or lack thereof, of an overriding function
3731+
shall be the same as that of the overridden function.
3732+
37263733
\pnum
37273734
The return type of an overriding function shall be either identical to
37283735
the return type of the overridden function or \defnx{covariant}{return type!covariant} with

0 commit comments

Comments
 (0)