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

           Summary: std.conv.to!int doesn't work in CTFE
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: thecybersha...@gmail.com


--- Comment #0 from Vladimir Panteleev <thecybersha...@gmail.com> 2011-11-15 
11:39:54 PST ---
The reason it doesn't work is scope(exit).

Looking at the code[1], it doesn't look like the scope(exit) is really
necessary here (I don't see why it should catch exceptions thrown by parse), so
until there's scope(...) CTFE support, a simple fix would be to rewrite the
code as:

    auto result = parse!T(v);
    if (v.length)
        convError!(SV, T)(v);
    return result;

[1]:
https://github.com/D-Programming-Language/phobos/blob/master/std/conv.d#L1606

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

Reply via email to