January 20, 2013 Re: Shadowing of members | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrey | On Wednesday, 16 January 2013 at 12:23:51 UTC, Andrey wrote: >> class B { >> protected int a=123; >> } >> >> class A : B { >> int f(int b) { >> //int a; // <--- I forgot to write this line >> ... >> a = b + 1; // <--- Oops! >> ... >> return a; >> } >> } > > That's why I don't understand, why D allows to refer to member variables and functions without "this". I always use "this" and don't have any problems. this.because(this.does(this.not(this.make(this.sense())))); or because().it().is().have().sense(); about subject: name convention - good code. |
Copyright © 1999-2021 by the D Language Foundation