how to pass a variable name in the template in this case?

Zhenya zheny at list.ru
Thu Aug 2 16:42:15 PDT 2012


I mean that in ths code

double f = 0;

template T(alias a)
{
	void doit()
	{
		a = 1;
	}
}

int main(string[] argv)
{
	T!f.doit();
	writeln(f);//alias a is'nt 0,alias a is f
	readln();
	return 0;
}
So why if we declared variable whith name 'f' something should 
change?



More information about the Digitalmars-d-learn mailing list