[Issue 18244] New: Generic functions in std.math cannot be overloaded

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 16 19:39:31 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18244

          Issue ID: 18244
           Summary: Generic functions in std.math cannot be overloaded
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: rumbu at rumbu.ro

There are functions in std.math accepting any parameter type instead of being
specialized on numeric types. 

This blocks overloading of such functions for other custom numeric types as
long as the end user imports std.math.

List of generic functions:

approxEqual
isFinite
isNormal
isSubnormal
NaN
nextafter
signbit
sgn

Special case: "abs" assumes wrongly that the comparison operator is pure @safe
nothrow @nogc for any imaginable type which supports T.init < 0;

--


More information about the Digitalmars-d-bugs mailing list