> I'm writing a CLI layer into my application, and I have several ref
> structs. Now, I've come into a situation that screams for a common
> interface, but because the structs are ref, I didn't see a reason why
> I couldn't have the structs implementing this interface. ANd it does
> work, but I'm concerned about the reprecussions of doing this. Is
> this good programming practice?
Apart from the fact that by default struct members are public and class
members are private, a ref struct is identical to a ref class. If you
explicitly set the visibility (to public, private, protected, or
internal), they work the same way and generate the same code.
> And what will the resulting struct translate to in c#.
No, ref class and ref struct both translate to C# class. value class and
value struct both translate to C# struct.
> I mean it is a ref struct, so I would imagine it
> would be what, a boxed something?
Nope, ref struct is not a value type, it doesn't get boxed. It's a
reference type, a C# class.
Tom