Re: List<> of struct with property. Cannot change value of property. why?
- From: Zytan <zytanlithium@xxxxxxxxx>
- Date: 14 May 2007 11:38:10 -0700
The compiler wisely
catches this.
NOTE, the compiler does NOT catch everything! The following code
escapes detection:
MyStruct x = new MyStruct();
list[index].MethodThatChangesStructsFields(x);
I guess this could be shortened to:
list[index].MethodThatChangesStructsFields();
And likely THAT escapes detection, as well. Damn! I've been changing
all my ararys that are created dynamically (length unknown) into
List<>, to avoid Array.Resize.
Zytan
.
- Follow-Ups:
- References:
- Prev by Date: Re: Print Document && Wrapping
- Next by Date: Re: Tracking a memory leak.
- Previous by thread: Re: List<> of struct with property. Cannot change value of property. why?
- Next by thread: Re: List<> of struct with property. Cannot change value of property. why?
- Index(es):