On 11/22/2013 02:43 PM, Jonathan M Davis wrote:
On Friday, November 22, 2013 14:29:46 Timon Gehr wrote:
>The request would be reasonable if 'value' was declared as follows though:
>
>@property T value(T)() if (is(T == int)) { return _intValue; }
>
>i.e. the fact that the template argument equals the type of the
>resulting call can be read off directly from the signature. This is in
>the same ballpark as the existing IFTI features.
How so? IFTI works by inferring the template arguments from the function
arguments. In this case, for the compiler to figure out a type that it could
use to instantiate the template, it would have to disect the template
constraint, which is compeletly different. Yes, this particular template
constraint ...
I am not talking about the template constraint at all. The following
would still be a signature that would work:
@property T value(T)(){ return _intValue; }