www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3239] New: std.conv.roundTo does not accept const/immutable/shared

reply d-bugmail puremagic.com writes:
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: nobody puremagic.com
        ReportedBy: hskwk 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: -------
Aug 10 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3239


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei metalanguage.com
         AssignedTo|nobody puremagic.com        |andrei metalanguage.com




-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 10 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3239


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED





11:05:42 PDT ---
Fixed. Purity is pending issue 3269.

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