Re: Struct inside class
- From: Göran Andersson <guffa@xxxxxxxxx>
- Date: Tue, 30 May 2006 13:54:41 +0200
Sneil wrote:
Barry Kelly wrote:
The memory for the struct s in this example is part of (i.e. fully
contained within) the heap-allocated object myClass.
OK, I think the same. BUT! In other words myClass.s.i1 is already in
heap, yes? Now - what is boxing? Boxing is creating special packed
version of value-type in heap. In our case i1 ALREADY in heap. So...
object o = myClass.s.i1; //_not_ a boxing here?
???
Yes, it's boxed. You are not storing the myClass.s.il variable in the object, you are storing a copy of the value of the myClass.s.il variable.
.
- Follow-Ups:
- Re: Struct inside class
- From: Jon Skeet [C# MVP]
- Re: Struct inside class
- References:
- Struct inside class
- From: Sneil
- Re: Struct inside class
- From: Barry Kelly
- Re: Struct inside class
- From: Sneil
- Struct inside class
- Prev by Date: Re: Struct inside class
- Next by Date: Re: need hep on parser error
- Previous by thread: Re: Struct inside class
- Next by thread: Re: Struct inside class
- Index(es):
Relevant Pages
|