disable all member function calls for rvalues?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Dec 18 09:32:10 PST 2009


Kagamin wrote:
> Kagamin Wrote:
> 
>> Andrei Alexandrescu Wrote:
>>
>>>     b.a = A.init;
>> The problem here is not in passing temporaries as this, the problem is that property assignment is ambiguous with opAssign called on the property's return value. Your proposed solution seems unrelated to the problem.
> 
> I think, possible solution is to disallow assign operations on the return value: =, +=, *=, ~=, ++ etc, but read operations should be allowed and functions should be callable by their symbolical names.

Won't help. Consider:

a.b.c.d.e.f = g;

If anywhere on the path an rvalue is created, the code is useless busywork.

Andrei



More information about the Digitalmars-d mailing list