I have a structure with some fields. One of the fields has a common type. A type of a generic type can be either a reference type or a value type .
I want it to be saved as a link inside to avoid too big a structure.
struct Foo<T> { T field;
I know I can use object or T[] , but both are awkward. Isn't there something like a generic Reference type?
struct Foo<T> { Reference<T> field; }
Yes, of course, I could write mine. But I try to avoid it.
reference c # value-type
Stefan steinegger
source share