Wrote a blog post about CTFE and D

bearophile bearophileHUGS at lycos.com
Thu Aug 30 04:25:54 PDT 2012


Danny Arends:

> http://www.dannyarends.nl/index.cgi?viewDetailed=00029


struct Coord(T : float){
   T[] d = [1.0, 0.0];


Maybe better ==>


struct Coord(T) if (isFloatingPoint!T) {
     T[2] d = [1.0, 0.0];


(isFloatingPoint is in std.traits)

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list