[Issue 3239] New: std.conv.roundTo does not accept const/immutable/shared
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Aug 10 02:29:22 PDT 2009
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 at puremagic.com
ReportedBy: hskwk at 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: -------
More information about the Digitalmars-d-bugs
mailing list