Yao G. <nospam...@gmail.com> wrote:
Thanks bearophile.
With respect to passing structs as reference, I also have this problem.
In the widget, I have a opIndex method, that returns a ListViewItem
given an index (like an array). When opIndex return the instance I'm
looking for, and then I modify some property (a image index, for
example) the change is only visible in the returned copy, but the
internal instance, the one stored in the collection (array in this case)
is not modified.
So use a ref return.
ref T opIndex( int index ) {
return arr[index];
}
--
Simen