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

           Summary: std.conv.roundTo does not accept
                    const/immutable/shared
           Product: D
           Version: 2.031
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: hs...@inter7.jp


std.conv.roundTo does not accept const/immutable/shared for its Source.
These attributes won't pass static asserts in std.conv.roundTo.
e.g.:

immutable real a = -2.3;
int b = roundTo!(int)(a);  // failure
int c = cast(int)std.math.round(a);  // success

It seems that static asserts in std.conv.roundTo should be replaced by
std.traits.isIntegral and std.traits.isFloatingPoint.

p.s.
I suppose roundTo is able to be pure function.

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

Reply via email to