On Sun, 03 Feb 2013 12:36:10 -0500, Andrei Alexandrescu
<[email protected]> wrote:
On 2/3/13 7:40 AM, kenji hara wrote:
2013/2/3 Steven Schveighoffer <[email protected]
<mailto:[email protected]>>
I have a possible suggestion to fix this within your proposal:
@property on single-arg free functions ONLY enables a setter mode,
it does not work as a UFCS getter.
[snip]
I was thinking the exact same thing.
Then we can't make this work:
@property ref T front(T[] array) { return array[0]; }
unittest
{
auto a = [ 1, 2, 3];
auto b = a.front;
}
ref T front(T[] array) { return array[0]; }
// same unittest
But I also can agree with the idea you currently have to make UFCS
properties require a 'this' initial parameter.
-Steve