Return by 'ref' problems...

Manu turkeyman at gmail.com
Fri May 4 03:09:27 PDT 2012


On 4 May 2012 12:52, Jacob Carlborg <doob at me.com> wrote:

> On 2012-05-04 10:38, Manu wrote:
>
>> This syntax complains, but it's precisely the same expression I use to
>
> pass an argument in to a function, and it's fine there:
>>   remedy\modules\hud.d(35):**Error: function remedy.hud.func without
>> 'this' cannot be const/immutable
>>
>> const ref Thing function() blah = &func;
>>
>
> Again this declares the variable const and not the return type. I'm not
> sure about the "ref" thing. I don't know if function pointers can return by
> reference, at least not the syntax.
>

Ah, of course! I didn't spot that >_<
Thanks.

I suppose technically, 'ref' can lead to the same ambiguity. This must be
the core of the problem. ref needs to be supported with parentheses?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120504/30e2f1f8/attachment.html>


More information about the Digitalmars-d mailing list