Mercurial > projects > dstress
view run/constructor_02.d @ 1330:f3f715978184
Georg Wrede <georg@iki.fi>
2007-01-07
mail:45A120F5.1050108@iki.fi
author | thomask |
---|---|
date | Sat, 13 Jan 2007 10:33:49 +0000 |
parents | 4cd33115f015 |
children | 52c9e86b6486 |
line wrap: on
line source
// $HeadURL$ // $Date$ // $Author$ // @author@ Bastiaan Veelo <Bastiaan.N.Veelo@ntnu.no> // @date@ 2004-09-21 // @uri@ news:cip39j$v4s$1@digitaldaemon.com // @url@ nntp://digitalmars.com/digitalmars.D.bugs/1890 module dstress.run.constructor_02; 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 MyClass(3); assert(status==5); return 0; }