You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change "better conversion target" to not require an expression
This effectively moves the method group aspect up from 11.6.4.6 to
11.6.4.4.
Notes:
I've added "for conversion C1" to the "single best method from the
method group" part as the single best method may be different for C1
and C2 - there's no single best method from a method group without
a specific method group conversion being considered
The rule doesn't refer to T2/C2, but I don't think it has to...
because it's valid for both conversions to be better than the other.
That's already the case in better conversion target, as types T1 and
T2 could both have implicit conversions to each other.
I think this means we could also remove "and E does not exactly
match T2" in the first rule of 11.6.4.4, but I haven't gone that far
in this PR.
Fixes#549Fixes#550
Copy file name to clipboardExpand all lines: standard/expressions.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1000,10 +1000,11 @@ In case the parameter type sequences `{P₁, P₂, ..., Pᵥ}` and `{Q₁, Q₂
1000
1000
1001
1001
#### 11.6.4.4 Better conversion from expression
1002
1002
1003
-
Given an implicit conversion `C₁` that converts from an expression `E` to a type `T₁`, and an implicit conversion `C₂` that converts from an expression `E` to a type `T₂`, `C₁` is a better conversion than `C₂` if one of the following holds:
1003
+
Given an implicit conversion `C₁` that converts from an expression `E` to a type `T₁`, and an implicit conversion `C₂` that converts from an expression `E` to a type `T₂`, `C₁` is a ***better conversion*** than `C₂` if one of the following holds:
1004
1004
1005
1005
- `E` exactly matches `T₁` and `E` does not exactly match `T₂` ([§11.6.4.5](expressions.md#11645-exactly-matching-expression))
1006
1006
- `E` exactlymatchesbothorneitherof `T₁` and `T₂`, and `T₁` isabetterconversiontargetthan `T₂` ([§11.6.4.6](expressions.md#11646-better-conversion-target))
0 commit comments