87 lines
4.8 KiB
Markdown
87 lines
4.8 KiB
Markdown
[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.3 Standard 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.3 Standard 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.3 Ranking 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.5 Reference 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.2 Lvalue-to-rvalue conversion") |
|
||
| [ð](#tab:over.ics.scs-row-4)<br> Array-to-pointer conversion | Lvalue Transformation | | [[conv.array]](conv.array "7.3.3 Array-to-pointer conversion") |
|
||
| [ð](#tab:over.ics.scs-row-5)<br> Function-to-pointer conversion | | Exact Match | [[conv.func]](conv.func "7.3.4 Function-to-pointer conversion") |
|
||
| [ð](#tab:over.ics.scs-row-6)<br> Qualification conversions | | | [[conv.qual]](conv.qual "7.3.6 Qualification conversions") |
|
||
| [ð](#tab:over.ics.scs-row-7)<br> Function pointer conversion | Qualification Adjustment | | [[conv.fctptr]](conv.fctptr "7.3.14 Function pointer conversions") |
|
||
| [ð](#tab:over.ics.scs-row-8)<br>Integral promotions | | | [[conv.prom]](conv.prom "7.3.7 Integral promotions") |
|
||
| [ð](#tab:over.ics.scs-row-9)<br> Floating-point promotion | Promotion | Promotion | [[conv.fpprom]](conv.fpprom "7.3.8 Floating-point promotion") |
|
||
| [ð](#tab:over.ics.scs-row-10)<br>Integral conversions | | | [[conv.integral]](conv.integral "7.3.9 Integral conversions") |
|
||
| [ð](#tab:over.ics.scs-row-11)<br> Floating-point conversions | | | [[conv.double]](conv.double "7.3.10 Floating-point conversions") |
|
||
| [ð](#tab:over.ics.scs-row-12)<br> Floating-integral conversions | | | [[conv.fpint]](conv.fpint "7.3.11 Floating-integral conversions") |
|
||
| [ð](#tab:over.ics.scs-row-13)<br> Pointer conversions | Conversion | Conversion | [[conv.ptr]](conv.ptr "7.3.12 Pointer conversions") |
|
||
| [ð](#tab:over.ics.scs-row-14)<br> Pointer-to-member conversions | | | [[conv.mem]](conv.mem "7.3.13 Pointer-to-member conversions") |
|
||
| [ð](#tab:over.ics.scs-row-15)<br> Boolean conversions | | | [[conv.bool]](conv.bool "7.3.15 Boolean conversions") |
|