RFC: scope and borrowing

Ivan Timokhin via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 12 13:24:50 PDT 2014


11.09.2014 22:45, "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm at gmx.net>" пишет:
>...
>>
>> This troubles me the most, because currently return type of a function
>> may depend only on types of its arguments, and there is a lot of
>> templated code written in that assumption.
>
> I'm sorry, I don't understand what you mean here. This is clearly not
> true, neither for normal functions, nor for templates.

Well, me and my bad English. I was trying to say that currently, AFAIK,
for any symbols f, a, b, if f(a) is valid and the types of a and b 
match, then f(b) is also valid and types of f(a) and f(b) match. OTOH, 
if the types of a and b are different, types of f(a) and f(b) may also 
be different (because of overloading or templates like T f(T)(T x)).

This would change if scope became a type qualifier and f was something 
like scope!x(T) f(T)(scope(T) x).

>...


More information about the Digitalmars-d mailing list