Type Qualifiers and Wild Cards

deadalnix deadalnix at gmail.com
Tue Nov 8 09:09:40 PST 2011


Le 08/11/2011 18:02, so a écrit :
> On Tue, 08 Nov 2011 18:56:59 +0200, Gor Gyolchanyan
> <gor.f.gyolchanyan at gmail.com> wrote:
>
>> Unless you write a template constraint, this will force you to use the
>> same type, instead of the same storage class.
>>
>> On Tue, Nov 8, 2011 at 8:42 PM, so <so at so.so> wrote:
>>> On Tue, 08 Nov 2011 16:39:35 +0200, so <so at so.so> wrote:
>>>
>>>> auto fun(return(type) a, ...)
>>>> return(T) fun(return(S) a, ...)
>>>
>>> Damn, nobody likes it, and i was expecting at least a nobel prize on
>>> math.
>>>
>
> return(T) fun(return(S) a, ...)
>
> Functions just like inout right now, and with:
>
> auto fun(return(type) a, ...)
>
> I meant to suggest if not said otherwise (as in the case above) we can
> just go return what it was passed.
> (I am not sure, probably inout already does this too)

You'll face a problem when it come to define variable within the 
function and not in its definition.

I'm affraid this will become very confusing in this case.


More information about the Digitalmars-d mailing list