class Foo
{
public Bar StructProperty { get; set; }
public int IntProperty { get; set; }
}
struct Bar
{
}
Let's assume I have a class that has a struct property. I do a var foo = new Foo()
.
How is foo.StructProperty
laid out in memory? Is it:
- Boxed on the heap or
- Contained within the heap address space belonging to the
foo
object itself (just likefoo.IntProperty
is laid out)?