Files
2025-10-25 03:02:53 +03:00

87 lines
4.8 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[over.ics.scs]
# 12 Overloading [[over]](./#over)
## 12.2 Overload resolution [[over.match]](over.match#over.ics.scs)
### 12.2.4 Best viable function [[over.match.best]](over.match.best#over.ics.scs)
#### 12.2.4.2 Implicit conversion sequences [[over.best.ics]](over.best.ics#over.ics.scs)
#### 12.2.4.2.2 Standard conversion sequences [over.ics.scs]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/overloading.tex#L2272)
Table [19](#tab:over.ics.scs "Table 19: Conversions") summarizes the conversions defined in [[conv]](conv "7.3Standard conversions") and
partitions them into four disjoint categories: Lvalue Transformation,
Qualification Adjustment, Promotion, and Conversion[.](#1.sentence-1)
[*Note [1](#note-1)*:
These categories are orthogonal with respect to value category,
cv-qualification, and data representation: the Lvalue Transformations
do not change the cv-qualification or data
representation of the type; the Qualification Adjustments do not
change the value category or data representation of the type; and
the Promotions and Conversions do not change the
value category or cv-qualification of the type[.](#1.sentence-2)
— *end note*]
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/overloading.tex#L2287)
[*Note [2](#note-2)*:
As described in [[conv]](conv "7.3Standard conversions"),
a standard conversion sequence either is the Identity conversion
by itself (that is, no conversion) or consists of one to three
conversions from the other
four categories[.](#2.sentence-1)
If there are two or more conversions in the sequence, the
conversions are applied in the canonical order:**Lvalue Transformation**,**Promotion** or**Conversion**,**Qualification Adjustment**[.](#2.sentence-2)
— *end note*]
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/overloading.tex#L2303)
Each conversion in Table [19](#tab:over.ics.scs "Table 19: Conversions") also has an associated rank (Exact
Match, Promotion, or Conversion)[.](#3.sentence-1)
These are used
to [rank standard conversion sequences](over.ics.rank "12.2.4.3Ranking implicit conversion sequences[over.ics.rank]")[.](#3.sentence-2)
The rank of a conversion sequence is determined by considering the
rank of each conversion in the sequence and the rank of any [reference
binding](over.ics.ref "12.2.4.2.5Reference binding[over.ics.ref]")[.](#3.sentence-3)
If any of those has Conversion rank, the
sequence has Conversion rank; otherwise, if any of those has Promotion rank,
the sequence has Promotion rank; otherwise, the sequence has Exact
Match rank[.](#3.sentence-4)
Table [19](#tab:over.ics.scs) — Conversions [[tab:over.ics.scs]](./tab:over.ics.scs)
| [🔗](#tab:over.ics.scs-row-1)<br>**Conversion** | **Category** | **Rank** | **Subclause** |
| --- | --- | --- | --- |
| [🔗](#tab:over.ics.scs-row-2)<br>No conversions required | Identity | | |
| [🔗](#tab:over.ics.scs-row-3)<br> Lvalue-to-rvalue conversion | | | [[conv.lval]](conv.lval "7.3.2Lvalue-to-rvalue conversion") |
| [🔗](#tab:over.ics.scs-row-4)<br> Array-to-pointer conversion | Lvalue Transformation | | [[conv.array]](conv.array "7.3.3Array-to-pointer conversion") |
| [🔗](#tab:over.ics.scs-row-5)<br> Function-to-pointer conversion | | Exact Match | [[conv.func]](conv.func "7.3.4Function-to-pointer conversion") |
| [🔗](#tab:over.ics.scs-row-6)<br> Qualification conversions | | | [[conv.qual]](conv.qual "7.3.6Qualification conversions") |
| [🔗](#tab:over.ics.scs-row-7)<br> Function pointer conversion | Qualification Adjustment | | [[conv.fctptr]](conv.fctptr "7.3.14Function pointer conversions") |
| [🔗](#tab:over.ics.scs-row-8)<br>Integral promotions | | | [[conv.prom]](conv.prom "7.3.7Integral promotions") |
| [🔗](#tab:over.ics.scs-row-9)<br> Floating-point promotion | Promotion | Promotion | [[conv.fpprom]](conv.fpprom "7.3.8Floating-point promotion") |
| [🔗](#tab:over.ics.scs-row-10)<br>Integral conversions | | | [[conv.integral]](conv.integral "7.3.9Integral conversions") |
| [🔗](#tab:over.ics.scs-row-11)<br> Floating-point conversions | | | [[conv.double]](conv.double "7.3.10Floating-point conversions") |
| [🔗](#tab:over.ics.scs-row-12)<br> Floating-integral conversions | | | [[conv.fpint]](conv.fpint "7.3.11Floating-integral conversions") |
| [🔗](#tab:over.ics.scs-row-13)<br> Pointer conversions | Conversion | Conversion | [[conv.ptr]](conv.ptr "7.3.12Pointer conversions") |
| [🔗](#tab:over.ics.scs-row-14)<br> Pointer-to-member conversions | | | [[conv.mem]](conv.mem "7.3.13Pointer-to-member conversions") |
| [🔗](#tab:over.ics.scs-row-15)<br> Boolean conversions | | | [[conv.bool]](conv.bool "7.3.15Boolean conversions") |