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

           Summary: std.conv.to isn't pure
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-09-10 12:51:04 PDT ---
This is a low-priority request, maybe a long-term one.

With dmd 2.048 this program shows that to!() is not pure:
test.d(3): Error: pure function 'main' cannot call impure function 'to'


import std.conv: to;
pure void main() {
    to!int("1");
}


But in theory the to!() doesn't need to change its inputs, and its output is
deterministic and fully determined by the input value. So eventually to!() may
become pure, so you may use it inside pure functions too.

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

Reply via email to