On 06/14/2015 05:50 PM, ketmar wrote:
On Sun, 14 Jun 2015 12:26:52 +0000, rcorre wrote:
Suppose I have a function defined like so:
void foo(int i) { }
intended to be called like:
5.foo
Should it be labeled with @property?
Or is @property only for true member functions?
only if you plan to use it like `foo = 5;`.
You can use it like that anyway.
i.e. exactly like field variable.
struct S{
void delegate() dg;
}
int main(){
S s;
s.dg=(){ writeln("!"); };
s.dg();
}
Now show me the UFCS way.
compiler will not complain, but putting `@property` here is
stylistically wrong.
It's neither wrong nor right.