Return by 'ref' problems...

Manu turkeyman at gmail.com
Fri May 4 08:48:50 PDT 2012


On 4 May 2012 18:07, Jakob Ovrum <jakobovrum at gmail.com> wrote:

> On Friday, 4 May 2012 at 14:57:14 UTC, Timon Gehr wrote:
>
>>
>> What would be the meaning of
>>
>> void foo(ref void function() fn) { }
>>
>> ?
>>
>
> Parameter storage classes can only go before the type, while function
> attributes can also go after the parameter list (of the function pointer or
> delegate for this case). So I would think that:
>
>
>    void foo(ref void function() fn) { }
>
> The above 'foo' would receive a function pointer by reference, while:
>
>    void foo(void function() ref fn) { }
>
> Would receive a function pointer which returns by ref.
>

It's very counter intuitive to mark the _function_ ref, rather than it's
return type.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120504/feca208f/attachment.html>


More information about the Digitalmars-d mailing list