Template

Vladimir v.voinkov at gmail.com
Thu Aug 9 01:56:18 PDT 2007


I tried to use common c++ technique in D:

class Super (alias T)
{
	alias T.Type A; >>> Error: no property 'Type' for type xxx.Sub'

	void test()
	{
		alias T.Type B; >>> ok
	}
}

class Sub : Super !(Sub)
{
	alias int Type;
}

alias A fails to compile although alias B inside scope of function is ok. Is that intended? What is the idea behind that?

Vladimir


More information about the Digitalmars-d-learn mailing list