Algebraic template instance holder

Voitech via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 10 02:31:34 PST 2016


Hi, why this is not working ?


class Base{
	int a;
}

class BaseTemplate(E):Base{
	E value;
	this(E value){
		this.value=value;
	}
}

class Concrete:BaseTemplate!int{
	this(int value){
		super(value);
	}
}
unittest{
	Algebraic!(Concrete) holder;
	Concrete a=new Concrete(4);
	holder =Algebraic!Concrete(a);
}


More information about the Digitalmars-d-learn mailing list