comparison compile/c/cfloat_12_B.d @ 1247:d75d907a68bb

[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments Sean Kelly <sean@f4.ca> 2006-11-27 news:bug-614-3@http.d.puremagic.com/issues/
author thomask
date Wed, 29 Nov 2006 21:20:30 +0000
parents
children daef239f37cf
comparison
equal deleted inserted replaced
1246:eb667a69ce7a 1247:d75d907a68bb
1 // $HeadURL$
2 // $Date$
3 // $Author$
4
5 // @author@ Sean Kelly <sean@f4.ca>
6 // @date@ 2006-11-27
7 // @uri@ news:bug-614-3@http.d.puremagic.com/issues/
8 // @desc@ [Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
9
10 module dstress.compile.c.cfloat_12_B;
11
12 const cfloat a = 1.0f + 2.0fi;
13
14 template getRealPart(cfloat x){
15 const float getRealPart = x.re;
16 }
17
18 static assert(getRealPart!(a) == 1.0f);
19
20
21 template getImaginaryPart(cfloat x){
22 const float getImanginaryPart = x.im;
23 }
24
25 static assert(getImaginaryPart!(a) == 2.0f);