# HG changeset patch # User thomask # Date 1173611176 0 # Node ID aaf99ec76365b3fdd64f545b8797b0651572333f # Parent 16360a39d7099317adec73d7e27876611b9e9340 Re: Compile time function execution... torhu 2007-02-15 http://www.digitalmars.com/webnews/newsgroups.php?search_txt=&group=digitalmars.D&article_id=48845 diff -r 16360a39d709 -r aaf99ec76365 compile/c/const_44_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/c/const_44_A.d Sun Mar 11 11:06:16 2007 +0000 @@ -0,0 +1,17 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ torhu +// @date@ 2007-02-15 +// @uri@ http://www.digitalmars.com/webnews/newsgroups.php?search_txt=&group=digitalmars.D&article_id=48845 +// @desc@ Re: Compile time function execution... + +module dstress.compile.c.const_44_A; + +int square(int x){ + return x * x; +} + +const int foo = square(5); +static assert(25 == foo); diff -r 16360a39d709 -r aaf99ec76365 compile/c/const_44_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/c/const_44_B.d Sun Mar 11 11:06:16 2007 +0000 @@ -0,0 +1,17 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ torhu +// @date@ 2007-02-15 +// @uri@ http://www.digitalmars.com/webnews/newsgroups.php?search_txt=&group=digitalmars.D&article_id=48845 +// @desc@ Re: Compile time function execution... + +module dstress.compile.c.const_44_B; + +double square(double x){ + return x * x; +} + +const double foo = square(5); +static assert(25 == foo); diff -r 16360a39d709 -r aaf99ec76365 compile/c/const_44_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/c/const_44_C.d Sun Mar 11 11:06:16 2007 +0000 @@ -0,0 +1,17 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ torhu +// @date@ 2007-02-15 +// @uri@ http://www.digitalmars.com/webnews/newsgroups.php?search_txt=&group=digitalmars.D&article_id=48845 +// @desc@ Re: Compile time function execution... + +module dstress.compile.c.const_44_C; + +double square(idouble x){ + return x * x; +} + +const double foo = square(5.0i); +static assert(25 == foo);