|
3338 | 3338 | form a list of subobjects.
|
3339 | 3339 | In that list, any subobject of array type is recursively expanded
|
3340 | 3340 | to the sequence of its elements, in the order of increasing subscript.
|
3341 |
| -Let \tcode{x}$_i$ be an lvalue denoting the $i^\textrm{th}$ element |
| 3341 | +Let $\tcode{x}_i$ be an lvalue denoting the $i^\text{th}$ element |
3342 | 3342 | in the expanded list of subobjects for an object \tcode{x}
|
3343 | 3343 | (of length $n$),
|
3344 |
| -where \tcode{x}$_i$ is |
| 3344 | +where $\tcode{x}_i$ is |
3345 | 3345 | formed by a sequence of
|
3346 | 3346 | derived-to-base conversions\iref{over.best.ics},
|
3347 | 3347 | class member access expressions\iref{expr.ref}, and
|
3348 | 3348 | array subscript expressions\iref{expr.sub} applied to \tcode{x}.
|
3349 |
| -The type of the expression \tcode{x}$_i$ \tcode{<=>} \tcode{x}$_i$ |
3350 |
| -is denoted by \tcode{R}$_i$. |
| 3349 | +The type of the expression $\tcode{x}_i$ \tcode{<=>} $\tcode{x}_i$ |
| 3350 | +is denoted by $\tcode{R}_i$. |
3351 | 3351 | It is unspecified
|
3352 | 3352 | whether virtual base class subobjects are compared more than once.
|
3353 | 3353 |
|
|
3357 | 3357 | is \tcode{auto},
|
3358 | 3358 | then the return type is deduced as
|
3359 | 3359 | the common comparison type (see below) of
|
3360 |
| -\tcode{R}$_0$, \tcode{R}$_1$, $\cdots$, \tcode{R}$_{n-1}$. |
| 3360 | +$\tcode{R}_0$, $\tcode{R}_1$, $\dotsc$, $\tcode{R}_{n-1}$. |
3361 | 3361 | \begin{note}
|
3362 | 3362 | Otherwise,
|
3363 | 3363 | the program will be ill-formed
|
3364 |
| -if the expression \tcode{x}$_i$ \tcode{<=>} \tcode{x}$_i$ |
| 3364 | +if the expression $\tcode{x}_i$ \tcode{<=>} $\tcode{x}_i$ |
3365 | 3365 | is not implicitly convertible to the declared return type for any $i$.
|
3366 | 3366 | \end{note}
|
3367 | 3367 | If the return type is deduced as \tcode{void},
|
|
3372 | 3372 | of the defaulted three-way comparison operator function
|
3373 | 3373 | with parameters \tcode{x} and \tcode{y} of the same type
|
3374 | 3374 | is determined by comparing corresponding elements
|
3375 |
| -\tcode{x}$_i$ and \tcode{y}$_i$ |
| 3375 | +$\tcode{x}_i$ and $\tcode{y}_i$ |
3376 | 3376 | in the expanded lists of subobjects for \tcode{x} and \tcode{y}
|
3377 | 3377 | until the first index $i$
|
3378 |
| -where \tcode{x}$_i$ \tcode{<=>} \tcode{y}$_i$ |
3379 |
| -yields a result value \tcode{v}$_i$ where \tcode{v}$_i$\tcode{ != 0}, |
| 3378 | +where $\tcode{x}_i$ \tcode{<=>} $\tcode{y}_i$ |
| 3379 | +yields a result value $\tcode{v}_i$ where $\tcode{v}_i \mathrel{\tcode{!=}} 0$, |
3380 | 3380 | contextually converted to \tcode{bool}, yields \tcode{true};
|
3381 |
| -\tcode{V} is \tcode{v}$_i$ converted to \tcode{R}. |
| 3381 | +\tcode{V} is $\tcode{v}_i$ converted to \tcode{R}. |
3382 | 3382 | If no such index exists, \tcode{V} is
|
3383 | 3383 | \tcode{std::strong_ordering::equal} converted to \tcode{R}.
|
3384 | 3384 |
|
3385 | 3385 | \pnum
|
3386 | 3386 | The \defn{common comparison type} \tcode{U}
|
3387 | 3387 | of a possibly-empty list of $n$ types
|
3388 |
| -\tcode{T}$_0$, \tcode{T}$_1$, $\cdots$, \tcode{T}$_{n-1}$ |
| 3388 | +$\tcode{T}_0$, $\tcode{T}_1$, $\dotsc$, $\tcode{T}_{n-1}$ |
3389 | 3389 | is defined as follows:
|
3390 | 3390 |
|
3391 | 3391 | \begin{itemize}
|
3392 | 3392 | \item
|
3393 |
| -If any \tcode{T}$_i$ |
| 3393 | +If any $\tcode{T}_i$ |
3394 | 3394 | is not a comparison category type\iref{cmp.categories},
|
3395 | 3395 | \tcode{U} is \tcode{void}.
|
3396 | 3396 |
|
3397 | 3397 | \item
|
3398 | 3398 | Otherwise, if
|
3399 |
| -at least one \tcode{T}$_i$ is \tcode{std::weak_equality}, or |
3400 |
| -at least one \tcode{T}$_i$ is \tcode{std::strong_equality} and |
3401 |
| -at least one \tcode{T}$_j$ is \tcode{std::partial_ordering} or |
| 3399 | +at least one $\tcode{T}_i$ is \tcode{std::weak_equality}, or |
| 3400 | +at least one $\tcode{T}_i$ is \tcode{std::strong_equality} and |
| 3401 | +at least one $\tcode{T}_j$ is \tcode{std::partial_ordering} or |
3402 | 3402 | \tcode{std::weak_ordering},
|
3403 | 3403 | \tcode{U} is \tcode{std::weak_equality}\iref{cmp.weakeq}.
|
3404 | 3404 |
|
3405 | 3405 | \item
|
3406 |
| -Otherwise, if at least one \tcode{T}$_i$ is \tcode{std::strong_equality}, |
| 3406 | +Otherwise, if at least one $\tcode{T}_i$ is \tcode{std::strong_equality}, |
3407 | 3407 | \tcode{U} is \tcode{std::strong_equality}\iref{cmp.strongeq}.
|
3408 | 3408 |
|
3409 | 3409 | \item
|
3410 |
| -Otherwise, if at least one \tcode{T}$_i$ is \tcode{std::partial_ordering}, |
| 3410 | +Otherwise, if at least one $\tcode{T}_i$ is \tcode{std::partial_ordering}, |
3411 | 3411 | \tcode{U} is \tcode{std::partial_ordering}\iref{cmp.partialord}.
|
3412 | 3412 |
|
3413 | 3413 | \item
|
3414 |
| -Otherwise, if at least one \tcode{T}$_i$ is \tcode{std::weak_ordering}, |
| 3414 | +Otherwise, if at least one $\tcode{T}_i$ is \tcode{std::weak_ordering}, |
3415 | 3415 | \tcode{U} is \tcode{std::weak_ordering}\iref{cmp.weakord}.
|
3416 | 3416 |
|
3417 | 3417 | \item
|
|
0 commit comments