Return by 'ref' problems...

Manu turkeyman at gmail.com
Fri May 4 16:33:44 PDT 2012


On 5 May 2012 02:32, Manu <turkeyman at gmail.com> wrote:

> On 4 May 2012 21:51, Artur Skawina <art.08.09 at gmail.com> wrote:
>
>> On 05/04/12 15:57, Manu wrote:
>> > Yeah I really hate this too. I'd like to see const(T) strictly
>> enforced, considering the potential for ambiguity in other situations.
>> >
>> > But I'm still stuck! :(
>> > How can I do what I need to do?
>>
>> If 'auto' is not an option:
>>
>>   alias ref const(S) function() FT;
>>   FT fp;
>>
>> (it's needed for things like 'extern (C)' too)
>>
>
> Huzzah! This is indeed the solution! I haven't seen another solution that
> works. now I just need to make sure I generate a unique name for the
> alias...
>
> I don't think this is needed for extern (C), I declare extern (C) function
> pointers all the time without any trick..?
>

That said, I don't think it's a 'solution', I'm pretty sure there's a bug
somewhere in this thread, but I'm not sure how the syntax should look...
the problem seems rather complicated when considering declaring functions,
declaring variables, and declaring function arguments which all overload
the meaning of these keywords...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120505/be4cddb1/attachment.html>


More information about the Digitalmars-d mailing list