Files
cppdraft_translate/cppdraft/over/ics/scs.md
2025-10-25 03:02:53 +03:00

4.8 KiB

[over.ics.scs]

12 Overloading [over]

12.2 Overload resolution [over.match]

12.2.4 Best viable function [over.match.best]

12.2.4.2 Implicit conversion sequences [over.best.ics]

12.2.4.2.2 Standard conversion sequences [over.ics.scs]

1

#

Table 19 summarizes the conversions defined in [conv] and partitions them into four disjoint categories: Lvalue Transformation, Qualification Adjustment, Promotion, and Conversion.

[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.

— end note]

2

#

[Note 2:

As described in [conv], 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.

If there are two or more conversions in the sequence, the conversions are applied in the canonical order:Lvalue Transformation,Promotion orConversion,Qualification Adjustment.

— end note]

3

#

Each conversion in Table 19 also has an associated rank (Exact Match, Promotion, or Conversion).

These are used to rank standard conversion sequences.

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.

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.

Table 19 — Conversions [tab:over.ics.scs]

🔗
Conversion
Category Rank Subclause
🔗
No conversions required
Identity
🔗
Lvalue-to-rvalue conversion
[conv.lval]
🔗
Array-to-pointer conversion
Lvalue Transformation [conv.array]
🔗
Function-to-pointer conversion
Exact Match [conv.func]
🔗
Qualification conversions
[conv.qual]
🔗
Function pointer conversion
Qualification Adjustment [conv.fctptr]
🔗
Integral promotions
[conv.prom]
🔗
Floating-point promotion
Promotion Promotion [conv.fpprom]
🔗
Integral conversions
[conv.integral]
🔗
Floating-point conversions
[conv.double]
🔗
Floating-integral conversions
[conv.fpint]
🔗
Pointer conversions
Conversion Conversion [conv.ptr]
🔗
Pointer-to-member conversions
[conv.mem]
🔗
Boolean conversions
[conv.bool]