On Wednesday, 11 April 2018 at 14:33:06 UTC, Adam D. Ruppe wrote:
On Wednesday, 11 April 2018 at 14:26:53 UTC, ixid wrote:
Is it possible to infer a template's return type from what
it's assigned to? If not is this a difficult or worthless
feature to add?
Not really. The function call needs
On Wednesday, 11 April 2018 at 14:26:53 UTC, ixid wrote:
Is it possible to infer a template's return type from what it's
assigned to? If not is this a difficult or worthless feature to
add?
Not really. The function call needs to make sense by itself:
fun(a)
needs to be a complete thing for
Is it possible to infer a template's return type from what it's
assigned to? If not is this a difficult or worthless feature to
add?
OUT fun(IN, OUT)(IN value) {
return value.to!OUT;
}
void main() {
float a = 5.0;
int b = fun(a);
}