Properties: a.b.c = 3

Bill Baxter wbaxter at gmail.com
Wed Jul 29 10:36:21 PDT 2009


On Wed, Jul 29, 2009 at 10:26 AM, Steven
Schveighoffer<schveiguy at yahoo.com> wrote:
> On Wed, 29 Jul 2009 13:22:14 -0400, Bill Baxter <wbaxter at gmail.com> wrote:
>
>> Similarly, taking the address should lead to an error.
>>
>> auto ptr = &a.b;  // ok if b is a field
>> auto ptr = &a.b; // bogus if b is a property returning a non-lvalue
>
> Impossible with the current implementation -- &a.b is a delegate :)

Good point.  I suppose we can chalk that up as another problem with
not having real properties.  Though if you were expecting it to be an
int* then you'll probably encounter a compiler sooner or later.  Just
might be far from where the actual problem is.

--bb



More information about the Digitalmars-d mailing list