Mercurial > projects > dstress
changeset 357:6a084cef863a
mixin ctor
Regan Heath <regan@netwin.co.nz>
2005-03-17
news:opsnp8x0v923k2f5@nrage.netwin.co.nz
author | thomask |
---|---|
date | Tue, 22 Mar 2005 19:59:20 +0000 |
parents | a1f59b48d72c |
children | 8a2ff09d62cb |
files | run/mixin_09.d run/mixin_10.d |
diffstat | 2 files changed, 57 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/mixin_09.d Tue Mar 22 19:59:20 2005 +0000 @@ -0,0 +1,28 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Regan Heath <regan@netwin.co.nz> +// @date@ 2005-03-17 +// @uri@ news:opsnp8x0v923k2f5@nrage.netwin.co.nz + +module dstress.run.mixin_09; + +class A { + template ctor(Type) + { + this(Type[] arr) + { + foreach(Type v; arr) writefln(typeid(typeof(v))); + } + } + + mixin ctor!(int); +} + +int main(){ + static int[] ints = [0,1,2,3]; + A a = new A(ints); + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/mixin_10.d Tue Mar 22 19:59:20 2005 +0000 @@ -0,0 +1,29 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Regan Heath <regan@netwin.co.nz> +// @date@ 2005-03-17 +// @uri@ news:opsnp8x0v923k2f5@nrage.netwin.co.nz + +module dstress.run.mixin_10; + +class A { + template ctor(Type) + { + this(Type[] arr) + { + foreach(Type v; arr) writefln(typeid(typeof(v))); + } + } + + mixin ctor!(int); + mixin ctor!(Object); +} + +int main(){ + static int[] ints = [0,1,2,3]; + A a = new A(ints); + return 0; +} +