alias this doesn't work for properties.

Tommi tommitissari at hotmail.com
Fri Aug 2 13:46:18 PDT 2013


On Friday, 2 August 2013 at 01:55:35 UTC, JS wrote:
> What is the difference between
>
> class A
> {
>     int x;
> }
>
> class A
> {
>     private int _x;
>     @property int x() { }
>     @property int x(int v) { }
> }
>
> ? From the outside world there is suppose to be no difference.

In the first case other modules can create a mutable pointer to 
the field x. In the second case other modules cannot create any 
pointer to field _x.


More information about the Digitalmars-d mailing list