On Wednesday, 15 August 2012 at 01:42:11 UTC, Ali Çehreli wrote:
Agreed. The function code must be compiled to use certain
amount of data from the program stack for that particular
parameter. That size of that parameter must be known at compile
time.
The compiler could in theory examine the entire program to
determine a type for the parameter but the separate compilation
model would preclude it.
Although if you used a template you could pull it off... I
think... But you'd need the sources for that.
void multiOut(T)(out T outType) {
outType = 100;
}
int a;
char b;
multiOut(a);
multiOut(b);
assert(a == 100);
assert(b == 100);