DIP28, on properties, availabel for destruction as well

angel andrey.gelman at gmail.com
Thu Feb 28 05:33:04 PST 2013


Possibly setters had better have 'void' as their return type.
Then
     auto a = b.setter = 3;
will have the predictable behavior with both 'a' and 'whatever 
b-setter sets' being set to 3. Otherwise, it might be totally 
unpredictable.

On the other hand, possibly setters MUST return a value of the 
same type they accept, in order to be able to emulate 
standard-like behavior.

When I re-read it, the 1-st option looks cleaner.


More information about the Digitalmars-d mailing list