Skip to content

Commit 71934df

Browse files
committed
[everywhere] Address a collection of minor editorial issues related to the concepts wording.
1 parent 508cd59 commit 71934df

File tree

4 files changed

+51
-47
lines changed

4 files changed

+51
-47
lines changed

source/derived.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@
695695
\begin{example}
696696
\begin{codeblock}
697697
struct A {
698-
virtual void f() requires true; // error: constrained virtual function
698+
virtual void f() requires true; // error: virtual function cannot be constrained~(\ref{temp.constr.decl})
699699
};
700700
\end{codeblock}
701701
\end{example}

source/expressions.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,10 @@
486486
that denotes the specialization of a concept~(\ref{temp.concept})
487487
results in a prvalue of type \tcode{bool}.
488488
The expression is \tcode{true} if
489-
the concept's normalized~(\ref{temp.constr.decl})
490-
\grammarterm{constraint-expression}
491-
is satisfied
492-
according to the rules in \ref{temp.constr.constr}
489+
the concept's normalized
490+
\grammarterm{constraint-expression}~(\ref{temp.constr.decl})
491+
is satisfied~(\ref{temp.constr.constr})
492+
by the specified template arguments
493493
and \tcode{false} otherwise.
494494
\begin{example}
495495
\begin{codeblock}
@@ -509,7 +509,7 @@
509509
A program that refers
510510
explicitly or implicitly
511511
to a function with a \grammarterm{requires-clause}
512-
whose \grammarterm{constraint-expression} is not satisfied~(\ref{temp.constr.decl}),
512+
whose \grammarterm{constraint-expression} is not satisfied,
513513
other than to declare it,
514514
is ill-formed.
515515
\begin{example}

source/overloading.tex

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,10 +1505,10 @@
15051505
context~(\ref{over.match.funcs}), a set of viable functions is
15061506
chosen, from which the best function will be selected by
15071507
comparing argument conversion sequences
1508-
and associated constraints
1508+
and associated constraints~(\ref{temp.constr.decl})
15091509
for the best fit~(\ref{over.match.best}).
15101510
The selection of viable functions considers
1511-
associated constraints, if any~(\ref{temp.constr.decl}), and
1511+
associated constraints, if any, and
15121512
relationships between arguments and function parameters other
15131513
than the ranking of conversion sequences.
15141514

@@ -2880,8 +2880,9 @@
28802880
described in~\ref{expr.unary.op}.
28812881

28822882
\pnum
2883-
All functions whose
2884-
associated constraints are not satisfied~(\ref{temp.constr.decl})
2883+
All functions with
2884+
associated constraints
2885+
that are not satisfied~(\ref{temp.constr.decl})
28852886
are eliminated from the set of selected functions.
28862887
If more than one function in the set remains,
28872888
all function template specializations

source/templates.tex

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -964,9 +964,9 @@
964964
all \grammarterm{template-argument}{s}
965965
in the \grammarterm{simple-template-id}
966966
are non-dependent~(\ref{temp.dep.temp}),
967-
the associated constraints
967+
the associated constraints~(\ref{temp.constr.decl})
968968
of the constrained template
969-
shall be satisfied~(\ref{temp.constr.decl}).
969+
shall be satisfied~(\ref{temp.constr.constr}).
970970
\begin{example}
971971
\begin{codeblock}
972972
template<typename T> concept C1 = sizeof(T) != sizeof(int);
@@ -1534,7 +1534,8 @@
15341534

15351535
\pnum
15361536
In order for a constrained template to be instantiated~(\ref{temp.spec}),
1537-
its associated constraints shall be \defn{satisfied}~(\ref{temp.constr.decl}).
1537+
its associated constraints~(\ref{temp.constr.decl})
1538+
shall be satisfied as described in the following subsections.
15381539
\begin{note}
15391540
Forming the name of a specialization of
15401541
a class template,
@@ -1545,8 +1546,6 @@
15451546
requires the satisfaction of constraints
15461547
on functions and function templates.
15471548
\end{note}
1548-
The rules for determining the satisfaction of different kinds of
1549-
constraints are defined in the following subsections.
15501549

15511550
\rSec3[temp.constr.op]{Logical operations}
15521551

@@ -1566,7 +1565,9 @@
15661565
\pnum
15671566
A \defn{conjunction} is a constraint taking two
15681567
operands.
1569-
To determine if a conjunction is satisfied, the satisfaction of
1568+
To determine if a conjunction is
1569+
\defnx{satisfied}{constraint!satisfaction!conjunction},
1570+
the satisfaction of
15701571
the first operand is checked.
15711572
If that is not satisfied, the conjunction is not satisfied.
15721573
Otherwise, the conjunction is satisfied if and only if the second
@@ -1576,7 +1577,9 @@
15761577
A \defn{disjunction} is a constraint taking two
15771578
operands.
15781579
%
1579-
To determine if a disjunction is satisfied, the satisfaction of
1580+
To determine if a disjunction is
1581+
\defnx{satisfied}{constraint!satisfaction!disjunction},
1582+
the satisfaction of
15801583
the first operand is checked.
15811584
If that is satisfied, the disjunction is satisfied.
15821585
Otherwise, the disjunction is satisfied if and only if the second
@@ -1627,8 +1630,10 @@
16271630
according to the rules for expressions described in \ref{temp.over.link}.
16281631

16291632
\pnum
1630-
Determining if a constraint is satisfied entails the substitution
1631-
of the parameter mapping and template arguments into that constraint.
1633+
To determine if an atomic constraint is
1634+
\defnx{satisfied}{constraint!satisfaction!atomic},
1635+
the parameter mapping and template arguments are
1636+
first substituted into its expression.
16321637
If substitution results in an invalid type or expression,
16331638
the constraint is not satisfied.
16341639
Otherwise, the lvalue-to-rvalue conversion~(\ref{conv.lval})
@@ -1638,25 +1643,22 @@
16381643
results in \tcode{true}.
16391644
\begin{example}
16401645
\begin{codeblock}
1641-
template<typename T>
1642-
concept C = sizeof(T) == 4 && !true; // requires atomic constraints
1643-
// \tcode{sizeof(T) == 4} and \tcode{!true}
1646+
template<typename T> concept C =
1647+
sizeof(T) == 4 && !true; // requires atomic constraints
1648+
// \tcode{sizeof(T) == 4} and \tcode{!true}
16441649

1645-
template<typename T>
1646-
struct S {
1647-
constexpr operator bool() const { return true; }
1648-
};
1650+
template<typename T> struct S {
1651+
constexpr operator bool() const { return true; }
1652+
};
16491653

1650-
template<typename T>
1651-
requires (S<T>{})
1652-
void f(T); // \#1
1653-
void f(int); // \#2
1654+
template<typename T> requires (S<T>{})
1655+
void f(T); // \#1
1656+
void f(int); // \#2
16541657

16551658
void g() {
1656-
f(0); // error: expression \tcode{S<int>\{\}} does not have type \tcode{bool}
1657-
// while checking satisfaction of deduced arguments of \#1,
1658-
// even though \#2 is a better match
1659-
}
1659+
f(0); // error: expression \tcode{S<int>\{\}} does not have type \tcode{bool}
1660+
} // while checking satisfaction of deduced arguments of \#1;
1661+
// call is ill-formed even though \#2 is a better match
16601662
\end{codeblock}
16611663
\end{example}
16621664

@@ -1799,7 +1801,7 @@
17991801
Normalization of \tcode{B}{'s} \grammarterm{constraint-expression}
18001802
is valid and results in
18011803
\tcode{T::value} (with the mapping \tcode{T}$\mapsto$\tcode{U*})
1802-
$\land$
1804+
$\lor$
18031805
\tcode{true} (with an empty mapping),
18041806
despite the expression \tcode{T::value} being ill-formed
18051807
for a pointer type \tcode{T}.
@@ -1828,10 +1830,10 @@
18281830
template<C4 U> void f3(U); // \#3
18291831
\end{codeblock}
18301832
The associated constraints of \#1 are
1831-
$\tcode{sizeof(T) == 1}$ (with mapping \tcode{T}$\mapsto$\tcode{U}) $\land \tcode{1 == 2}$,
1832-
those of \#2 are
1833-
$\tcode{requires \{ typename T::type; \}}$ (with mapping \tcode{T}$\mapsto$\tcode{U}),
1834-
those of \#3 are
1833+
$\tcode{sizeof(T) == 1}$ (with mapping \tcode{T}$\mapsto$\tcode{U}) $\land \tcode{1 == 2}$.\\
1834+
The associated constraints of \#2 are
1835+
$\tcode{requires \{ typename T::type; \}}$ (with mapping \tcode{T}$\mapsto$\tcode{U}).\\
1836+
The associated constraints of \#3 are
18351837
$\tcode{requires (T x) \{ ++x; \}}$ (with mapping \tcode{T}$\mapsto$\tcode{U}).
18361838
\end{example}
18371839
\indextext{constraint!normalization|)}
@@ -2354,7 +2356,7 @@
23542356
a \grammarterm{template-head} equivalent to that
23552357
of the class template followed by
23562358
a \grammarterm{template-head} equivalent to that
2357-
of the member template.
2359+
of the member template~(\ref{temp.over.link}).
23582360
\begin{example}
23592361
\begin{codeblock}
23602362
template<class T> struct string {
@@ -3561,8 +3563,8 @@
35613563
involving template parameters.
35623564
Two \grammarterm{template-head}{s} are
35633565
\defnx{functionally equivalent}{functionally equivalent!\idxgram{template-head}{s}}
3564-
if they accept and are satisfied by the same set of template argument
3565-
lists.
3566+
if they accept and are satisfied by~(\ref{temp.constr.constr})
3567+
the same set of template argument lists.
35663568

35673569
\pnum
35683570
\indextext{template!function!equivalent|see{equivalent, function template}}%
@@ -3867,9 +3869,10 @@
38673869

38683870
\pnum
38693871
A \grammarterm{concept-definition}
3870-
declares its \grammarterm{identifier}
3871-
to be a concept.
3872-
The name of the concept is a \grammarterm{concept-name}.
3872+
declares a concept.
3873+
Its \grammarterm{identifier} becomes a \grammarterm{concept-name}
3874+
referring to that concept
3875+
within its scope.
38733876
\begin{example}
38743877
\begin{codeblock}
38753878
template<typename T>
@@ -6057,7 +6060,7 @@
60576060
the translation unit containing the explicit instantiation,
60586061
provided that the associated constraints, if any,
60596062
of that member are satisfied by the template arguments of the explicit
6060-
instantiation~(\ref{temp.constr.decl}),
6063+
instantiation~(\ref{temp.constr.decl}, \ref{temp.constr.constr}),
60616064
except as described below.
60626065
\begin{note} In addition, it will typically be an explicit instantiation of certain
60636066
implementation-dependent data about the class. \end{note}
@@ -6962,7 +6965,7 @@
69626965
or default argument values. If the substitution results in an
69636966
invalid type, as described above, type deduction fails.
69646967
If the function template has associated constraints~(\ref{temp.constr.decl}),
6965-
those constraints are checked for satisfaction~(\ref{temp.constr}).
6968+
those constraints are checked for satisfaction~(\ref{temp.constr.constr}).
69666969
If the constraints are not satisfied, type deduction fails.
69676970

69686971
\pnum

0 commit comments

Comments
 (0)