Calls to struct methods and immutable

Ali Çehreli acehreli at yahoo.com
Thu Nov 15 11:13:35 PST 2012


On 11/15/2012 10:48 AM, Ali Çehreli wrote:

 > assert(foo.a[0] == 42);
 > a[0] = 43;
 > assert(foo.a[1] == 43); // <-- if compiled, this would be a bug

Of course I meant foo.a[0] on the last line above as well.

Ali



More information about the Digitalmars-d-learn mailing list