[Issue 24142] New: Allow casting Int128 to integral and floating types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 12 11:57:03 UTC 2023


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

          Issue ID: 24142
           Summary: Allow casting Int128 to integral and floating types
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: n8sh.secondary at hotmail.com

Currently Unsupported:

---
import std.int128;

int fun1(Int128 a)
{
    return cast(int) a;
}
double fun2(Int128 a)
{
    return cast(double) a;
}
---

Error: template instance `opCast!int` does not match template declaration
`opCast(T : bool)()`
Error: template instance `opCast!double` does not match template declaration
`opCast(T : bool)()`

--


More information about the Digitalmars-d-bugs mailing list