Created
July 26, 2023 02:07
-
-
Save ufcpp/f577fd443154c75d05d47ba28299b269 to your computer and use it in GitHub Desktop.
default リテラルのオーバーロード解決?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X.M(0); // 整数リテラルの自然な型は int | |
X.M(default); // でも、 default は「サイズが小さい型優先」っぽい | |
// そういう仕様?意図的? | |
class X | |
{ | |
public static void M(int i32) { } | |
public static void M(short i16) { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment