view run/constructor_02.d @ 2:de27ca625bf7

extended abstract/alias and template tests
author thomask
date Sun, 26 Sep 2004 12:07:39 +0000
parents
children 5f98d4a33d49
line wrap: on
line source

// @author@	Bastiaan Veelo <Bastiaan.N.Veelo@ntu.no>
// @date@	2004-09-21

int status;

template ctor(){
	this(){
		this(2);
	}
	this(int i){
		status+=i;
	}
}

class MyClass{
	mixin ctor;
}

int main(){
	assert(status==0);
	MyClass object = new MyClass();
	assert(status==2);
	object = new MyObject(3);
	assert(status==5);
	return 0;
}