Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- public static void Write(MyInt v)
- {
- //Console.WriteLine("{0}", v.v is byte);
- }
- static void Main(string[] args)
- {
- Write((byte)2);
- }
- }
- public struct MyInt2
- {
- public object v;
- public MyInt2(byte vv) { v = vv; }
- public MyInt2(short vv) { v = vv; }
- public MyInt2(byte[] vv) { v = vv; }
- public static implicit operator MyInt2(byte vv) { return new MyInt2 { v = vv }; }
- //public static extern implicit operator MyInt(int vv);
- }
- struct MyInt
- {
- public MyInt2 v;
- MyInt(MyInt2 vv) { v = vv; }
- public static implicit operator MyInt(MyInt2 vv) { return new MyInt { v = vv }; }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement