[Issue 6419] [CTFE] Cannot create a non-static nested struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 2 12:29:48 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=6419


ponce <aliloko at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aliloko at gmail.com


--- Comment #6 from ponce <aliloko at gmail.com> 2012-07-02 12:32:26 PDT ---
This is sad because you can't do compile-time FizzBuzz :)

-------------------
import std.stdio, std.conv, std.range, std.algorithm;

void main()
{
    enum fizzbuzz = iota(1, 100)
        .map!(x =>
            (0 == x % 15) ? "FizzBuzz" : 
            (0 == x % 5) ? "Buzz" : 
            (0 == x % 3) ? "Fizz" : to!string(x))
        .joiner("\n");
    writeln(fizzbuzz);
}
-------------------

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list