DIP25 draft available for destruction
deadalnix
deadalnix at gmail.com
Thu Feb 7 19:05:58 PST 2013
On Thursday, 7 February 2013 at 14:43:38 UTC, Steven
Schveighoffer wrote:
> On Thu, 07 Feb 2013 01:06:34 -0500, Walter Bright
> <newshound2 at digitalmars.com> wrote:
>
>>
>> The only time (now) that you can take the address of function
>> return value is if that is a return by ref. So, if taking the
>> address of a ref is disallowed, then the syntax is no longer
>> ambiguous.
>
> Thinking about this, I don't know that I like the idea of
> disallowing taking the address of ref.
>
> One major usage of taking the address of ref returns is the
> opIndex operator:
>
> int *ptr = &arr[0];
>
> Or, more generally, the front property of a range:
>
> int *ptr = &arr.front;
>
> What I am concerned about is that this is not going to have the
> desired effect. Instead of grudgingly switching to a new style
> of coding, people will simply return pointers instead of ref.
>
Exactly.
More information about the Digitalmars-d
mailing list