www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18244] New: Generic functions in std.math cannot be overloaded

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 puremagic.com
          Reporter: rumbu 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;

--
Jan 16