foreach (x; a .. b) and foreach_reverse (x; a .. b) should be disallowed for floats

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun May 17 17:28:24 PDT 2009


Consider:

     foreach (x; 1.0 .. 4.1) writeln(x);
     foreach_reverse (x; 1.0 .. 4.1) writeln(x);

This sucks. foreach with interval for floating-point types should be 
disallowed.


Andrei



More information about the Digitalmars-d mailing list