|
80 | 80 | well-formed if and only if \tcode{e} can be implicitly converted to a type \tcode{T}
|
81 | 81 | that is determined as follows:
|
82 | 82 | \tcode{E} is searched for non-explicit conversion functions
|
83 |
| -whose return type is \cvqual{cv} \tcode{T} or reference to \cvqual{cv} |
| 83 | +whose return type is \cv{} \tcode{T} or reference to \cv{} |
84 | 84 | \tcode{T} such that \tcode{T} is allowed by the context.
|
85 | 85 | There shall be exactly one such \tcode{T}.
|
86 | 86 |
|
|
241 | 241 | \pnum
|
242 | 242 | A \defn{cv-decomposition} of a type \tcode{T}
|
243 | 243 | is a sequence of
|
244 |
| -$cv_i$ and $P_i$ |
| 244 | +$\cv{}_i$ and $P_i$ |
245 | 245 | such that \tcode{T} is
|
246 | 246 | \begin{indented}
|
247 |
| -``$cv_0$ $P_0$ $cv_1$ $P_1$ $\cdots$ $cv_{n-1}$ $P_{n-1}$ $cv_n$ \tcode{U}'' for $n > 0$, |
| 247 | +``$\cv{}_0$ $P_0$ $\cv{}_1$ $P_1$ $\cdots$ $\cv{}_{n-1}$ $P_{n-1}$ $\cv{}_n$ \tcode{U}'' for $n > 0$, |
248 | 248 | \end{indented}
|
249 | 249 | where
|
250 |
| -each $cv_i$ is a set of cv-qualifiers\iref{basic.type.qualifier}, and |
| 250 | +each $\cv{}_i$ is a set of cv-qualifiers\iref{basic.type.qualifier}, and |
251 | 251 | each $P_i$ is
|
252 | 252 | ``pointer to''\iref{dcl.ptr},
|
253 | 253 | ``pointer to member of class $C_i$ of type''\iref{dcl.mptr},
|
254 | 254 | ``array of $N_i$'', or
|
255 | 255 | ``array of unknown bound of''\iref{dcl.array}.
|
256 | 256 | If $P_i$ designates an array,
|
257 |
| -the cv-qualifiers $cv_{i+1}$ on the element type are also taken as |
258 |
| -the cv-qualifiers $cv_i$ of the array. |
| 257 | +the cv-qualifiers $\cv{}_{i+1}$ on the element type are also taken as |
| 258 | +the cv-qualifiers $\cv{}_i$ of the array. |
259 | 259 | \begin{example}
|
260 | 260 | The type denoted by the \grammarterm{type-id} \tcode{const int **}
|
261 | 261 | has two cv-decompositions,
|
262 | 262 | taking \tcode{U} as ``\tcode{int}'' and as ``pointer to \tcode{const int}''.
|
263 | 263 | \end{example}
|
264 | 264 | The $n$-tuple of cv-qualifiers after the first one
|
265 | 265 | in the longest cv-decomposition of \tcode{T}, that is,
|
266 |
| -$cv_1, cv_2, \dotsc, cv_n$, is called the |
| 266 | +$\cv{}_1, \cv{}_2, \dotsc, \cv{}_n$, is called the |
267 | 267 | \defn{cv-qualification signature} of \tcode{T}.
|
268 | 268 |
|
269 | 269 | \pnum
|
|
280 | 280 | % NB: forbid line break between 'where' and 'cv'
|
281 | 281 | % to stop superscript j from running into
|
282 | 282 | % descender of p on the previous line.
|
283 |
| -where~$cv_i^j$ denotes the cv-qualifiers in the cv-qualification signature of $\tcode{T}_j$:% |
| 283 | +where~$\cv{}_i^j$ denotes the cv-qualifiers in the cv-qualification signature of $\tcode{T}_j$:% |
284 | 284 | \footnote{These rules ensure that const-safety is preserved by the conversion.}
|
285 | 285 |
|
286 | 286 | \begin{itemize}
|
287 | 287 | \item $\tcode{T}_1$ and $\tcode{T}_2$ are similar.
|
288 | 288 |
|
289 |
| -\item For every $i > 0$, if \tcode{const} is in $\text{\cv}_i^1$ then \tcode{const} is in $\text{\cv}_i^2$, and similarly for \tcode{volatile}. |
| 289 | +\item For every $i > 0$, if \tcode{const} is in $\cv{}_i^1$ then \tcode{const} is in $\cv{}_i^2$, and similarly for \tcode{volatile}. |
290 | 290 |
|
291 |
| -\item If the $\text{\cv}_i^1$ and $\text{\cv}_i^2$ are different, |
292 |
| -then \tcode{const} is in every $\text{\cv}_k^2$ for $0 < k < i$. |
| 291 | +\item If the $\cv{}_i^1$ and $\cv{}_i^2$ are different, |
| 292 | +then \tcode{const} is in every $\cv{}_k^2$ for $0 < k < i$. |
293 | 293 | \end{itemize}
|
294 | 294 |
|
295 | 295 | \begin{note}
|
|
507 | 507 | \begin{note} The resulting prvalue is not a null pointer value. \end{note}
|
508 | 508 |
|
509 | 509 | \pnum
|
510 |
| -A prvalue of type ``pointer to \cvqual{cv} \tcode{T}'', where \tcode{T} |
| 510 | +A prvalue of type ``pointer to \cv{} \tcode{T}'', where \tcode{T} |
511 | 511 | is an object type, can be converted to a prvalue of type ``pointer to
|
512 |
| -\cvqual{cv} \tcode{void}''. |
| 512 | +\cv{} \tcode{void}''. |
513 | 513 | The pointer value\iref{basic.compound} is unchanged by this conversion.
|
514 | 514 |
|
515 | 515 | \pnum
|
516 |
| -A prvalue of type ``pointer to \cvqual{cv} \tcode{D}'', where \tcode{D} |
| 516 | +A prvalue of type ``pointer to \cv{} \tcode{D}'', where \tcode{D} |
517 | 517 | is a class type, can be converted to a prvalue of type ``pointer to
|
518 |
| -\cvqual{cv} \tcode{B}'', where \tcode{B} is a base class\iref{class.derived} |
| 518 | +\cv{} \tcode{B}'', where \tcode{B} is a base class\iref{class.derived} |
519 | 519 | of \tcode{D}. If \tcode{B} is an
|
520 | 520 | inaccessible\iref{class.access} or
|
521 | 521 | ambiguous\iref{class.member.lookup} base class of \tcode{D}, a program
|
|
543 | 543 | followed by a qualification conversion\iref{conv.qual}.
|
544 | 544 |
|
545 | 545 | \pnum
|
546 |
| -A prvalue of type ``pointer to member of \tcode{B} of type \cvqual{cv} |
| 546 | +A prvalue of type ``pointer to member of \tcode{B} of type \cv{} |
547 | 547 | \tcode{T}'', where \tcode{B} is a class type, can be converted to
|
548 |
| -a prvalue of type ``pointer to member of \tcode{D} of type \cvqual{cv} |
| 548 | +a prvalue of type ``pointer to member of \tcode{D} of type \cv{} |
549 | 549 | \tcode{T}'', where \tcode{D} is a derived class\iref{class.derived}
|
550 | 550 | of \tcode{B}. If \tcode{B} is an
|
551 | 551 | inaccessible\iref{class.access},
|
|
556 | 556 | member before the conversion took place, but it refers to the base class
|
557 | 557 | member as if it were a member of the derived class. The result refers to
|
558 | 558 | the member in \tcode{D}'s instance of \tcode{B}. Since the result has
|
559 |
| -type ``pointer to member of \tcode{D} of type \cvqual{cv} \tcode{T}'', |
| 559 | +type ``pointer to member of \tcode{D} of type \cv{} \tcode{T}'', |
560 | 560 | indirection through it with a \tcode{D} object is valid. The result is the same
|
561 | 561 | as if indirecting through the pointer to member of \tcode{B} with the
|
562 | 562 | \tcode{B} subobject of \tcode{D}. The null member pointer value is
|
|
0 commit comments