That was just a test I tried. I want to make a type which behaves exactly like int. I tried to make a proxy type like this:
class myint : int { }
but then myint won’t be value type. Is there a way to create a proxy type of int?
P.S. I know about extension methods.
Value types can only implement interfaces – you can’t inherit from another value type.
So, you can’t inherit from
int.You can wrap an
intin a class/struct as a field.