Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
MyClass c = 10;
このコードを機能させる方法はありますか? 暗黙的な演算子のオーバーロードにより、反対のことが機能することを知っています。
int i = instanceOfMyClass;
ありがとう
もちろん...
class MyClass { public static implicit operator MyClass(int value) { /* your code */ } }