DIP23 draft: Fixing properties redux

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Feb 3 10:42:57 PST 2013


On 2/3/13 1:32 PM, TommiT wrote:
> On Sunday, 3 February 2013 at 18:28:06 UTC, Andrei Alexandrescu wrote:
>> [..]
>> This is a matter of visibility. The presence of a member precludes any
>> UFCS. Won't compile. Same for the 2nd example.
>
> Just to be perfectly clear, it must be that this wouldn't compile
> either, right?
>
> struct S
> {
> int _n;
>
> @property int prop() const
> {
> return _n;
> }
> }
>
> @property void prop(ref S s, int n)
> {
> s._n = 42;
> }
>
> void main()
> {
> S s;
> s.prop = 10;
> }

Nope.

Andrei


More information about the Digitalmars-d mailing list