|
226 | 226 | the \grammarterm{constraint-logical-or-expression} as a |
227 | 227 | \grammarterm{constraint-expression}. |
228 | 228 | The \grammarterm{constraint-logical-or-expression} of a |
229 | | -\grammarterm{requires-clause} is an unevaluated operand\iref{expr}. |
| 229 | +\grammarterm{requires-clause} is an unevaluated operand\iref{expr.context}. |
230 | 230 | \begin{note} |
231 | 231 | The expression in a \grammarterm{requires-clause} |
232 | 232 | uses a restricted grammar to avoid ambiguities. |
|
940 | 940 | \end{codeblock} |
941 | 941 | \end{example} |
942 | 942 |
|
| 943 | +\pnum |
| 944 | +A \defn{concept-id} is a \grammarterm{simple-template-id} |
| 945 | +where the \grammarterm{template-name} is a \grammarterm{concept-name}. |
| 946 | +A concept-id is a prvalue of type \tcode{bool}, and |
| 947 | +does not name a template specialization. |
| 948 | +A concept-id evaluates to \tcode{true} |
| 949 | +if the concept's |
| 950 | +normalized \grammarterm{constraint-expression}\iref{temp.constr.decl} |
| 951 | +is satisfied\iref{temp.constr.constr} by the specified template arguments and |
| 952 | +\tcode{false} otherwise. |
| 953 | +\begin{note} |
| 954 | +Since a \grammarterm{constraint-expression} is an unevaluated operand, |
| 955 | +a concept-id appearing in a \grammarterm{constraint-expression} |
| 956 | +is not evaluated except as necessary |
| 957 | +to determine whether the normalized constraints are satisfied. |
| 958 | +\end{note} |
| 959 | +\begin{example} |
| 960 | +\begin{codeblock} |
| 961 | +template<typename T> concept C = true; |
| 962 | +static_assert(C<int>); // OK |
| 963 | +\end{codeblock} |
| 964 | +\end{example} |
| 965 | + |
943 | 966 | \rSec1[temp.arg]{Template arguments} |
944 | 967 |
|
945 | 968 | \pnum |
|
1754 | 1777 | the normal forms of \tcode{E1} and \tcode{E2}. |
1755 | 1778 |
|
1756 | 1779 | \item |
1757 | | -The normal form of an \grammarterm{id-expression} of the form |
1758 | | -\tcode{C<A$_1$, A$_2$, ..., A$_n$>}, where \tcode{C} names a concept, |
| 1780 | +The normal form of a concept-id \tcode{C<A$_1$, A$_2$, ..., A$_n$>} |
1759 | 1781 | is the normal form of the \grammarterm{constraint-expression} of \tcode{C}, |
1760 | 1782 | after substituting \tcode{A$_1$, A$_2$, ..., A$_n$} for |
1761 | 1783 | \tcode{C}{'s} respective template parameters in the |
|
3556 | 3578 | to name the template parameters may differ as long as a token used to |
3557 | 3579 | name a template parameter in one expression is replaced by another token |
3558 | 3580 | that names the same template parameter in the other expression. |
| 3581 | +Two unevaluated operands that do not involve template parameters |
| 3582 | +are considered equivalent |
| 3583 | +if two function definitions containing the expressions |
| 3584 | +would satisfy the one-definition rule, |
| 3585 | +except that the tokens used to name types and declarations may differ |
| 3586 | +as long as they name the same entities, and |
| 3587 | +the tokens used to form concept-ids may differ |
| 3588 | +as long as the two \grammarterm{template-id}{s} |
| 3589 | +would be considered to name the same type if, |
| 3590 | +instead of a concept, a class template were named. |
| 3591 | +\begin{note} |
| 3592 | +For instance, \tcode{A<42>} and \tcode{A<40+2>} name the same type. |
| 3593 | +\end{note} |
3559 | 3594 | Two \grammarterm{lambda-expression}{s} are never considered equivalent. |
3560 | 3595 | \begin{note} |
3561 | 3596 | The intent is to avoid \grammarterm{lambda-expression}{s} appearing in the |
|
3588 | 3623 | \end{codeblock} |
3589 | 3624 | \end{example} |
3590 | 3625 | \indextext{expression!functionally equivalent|see{functionally equivalent, expressions}}% |
3591 | | -Two expressions involving template parameters that are not equivalent are |
| 3626 | +Two potentially-evaluated expressions involving template parameters that are not equivalent are |
3592 | 3627 | \defnx{functionally equivalent}{functionally equivalent!expressions} |
3593 | 3628 | if, for any given set of template arguments, the evaluation of the |
3594 | 3629 | expression results in the same value. |
| 3630 | +Two unevaluated operands that are not equivalent |
| 3631 | +are functionally equivalent if, for any given set of template arguments, |
| 3632 | +the expressions perform |
| 3633 | +the same operations in the same order with the same entities. |
| 3634 | +\begin{note} |
| 3635 | +For instance, one could have redundant parentheses. |
| 3636 | +\end{note} |
3595 | 3637 |
|
3596 | 3638 | \pnum |
3597 | 3639 | Two \grammarterm{template-head}{s} are |
|
3972 | 4014 | \pnum |
3973 | 4015 | A concept is not instantiated\iref{temp.spec}. |
3974 | 4016 | \begin{note} |
3975 | | -An \grammarterm{id-expression} that denotes a concept specialization |
3976 | | -is evaluated as an expression\iref{expr.prim.id}. |
| 4017 | +A concept-id\iref{temp.names} is evaluated as an expression. |
3977 | 4018 | A concept cannot be |
3978 | 4019 | explicitly instantiated\iref{temp.explicit}, |
3979 | 4020 | explicitly specialized\iref{temp.expl.spec}, |
3980 | 4021 | or partially specialized. |
3981 | 4022 | \end{note} |
3982 | 4023 |
|
| 4024 | +\pnum |
| 4025 | +The \grammarterm{constraint-expression} of a \grammarterm{concept-definition} |
| 4026 | +is an unevaluated operand\iref{expr.context}. |
| 4027 | + |
3983 | 4028 | \pnum |
3984 | 4029 | The first declared template parameter of a concept definition is its |
3985 | 4030 | \defnx{prototype parameter}{prototype parameter!concept}. |
|
0 commit comments