alias this to a template function

Adam D. Ruppe destructionator at gmail.com
Sun Nov 11 13:36:40 PST 2012


I'm just curious if this is supposed to eventually work:

struct Test {
	alias get this;
	T get(T)() {
		return T.init;
	}
}

void main() {
	Test t;
	int a = t;
}


Where the int a = t would be expanded to int a = t.get!int;

The TDPL book says multiple alias this is supposed to be allowed, 
so you can subtype multiple things, but I'm wondering if we're 
eventually going to get the template to do multiple subtypes with 
one function.


More information about the Digitalmars-d mailing list