Optional function invocation parentheses
Will Rubin
Will.Rubin at zippymail.info
Thu Sep 20 07:32:55 PDT 2012
Just a _write_ property:
struct Bleem {
int _value;
public:
//@property int value() { return _value; }
@property int value(int newValue) { return _value = newValue; }
}
void main() {
auto bleem = Bleem();
writeln("Result: ", bleem.value = 9);
}
Application Output
Result: 9
Off the top of my head (C#, Delphi, Python) have them return
void. Maybe it's not so uncommon though.
On Thursday, 20 September 2012 at 13:57:54 UTC, monarch_dodra
wrote:
>> A bit interesting to see I can declare a write property that
>> returns a value rather than void.
>>
> Why would a property return void. If anything, it would return
> a non void:
>
> auto a = someRange.front;
>
> front is a property that returns a value.
More information about the Digitalmars-d-learn
mailing list