Bug 15212 – BigInt should implement opCast!long and opCast!int

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-10-17T00:00:00Z
Last change time
2016-01-03T14:14:48Z
Keywords
pull
Assigned to
nobody
Creator
dlang-bugzilla
See also
https://issues.dlang.org/show_bug.cgi?id=15211, https://issues.dlang.org/show_bug.cgi?id=12940

Comments

Comment #0 by dlang-bugzilla — 2015-10-17T00:00:41Z
Currently, to convert a BigInt to a naked long/int, you have to call the awkward toLong/toInt methods. The type should also provide these conversion operations via opCast, so they are accessible to std.conv.to.
Comment #1 by dlang-bugzilla — 2015-10-17T00:35:02Z
Comment #2 by github-bugzilla — 2015-10-18T04:43:40Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/9bb4da24561171cf96ea4ca5f090c3be0513653b fix Issue 15212 - BigInt should implement opCast!long and opCast!int https://github.com/D-Programming-Language/phobos/commit/06506e407aeb83d569f0a7e01ca54c45920f957c Merge pull request #3725 from CyberShadow/pull-20151017-003315 fix Issue 15212 - BigInt should implement opCast!long and opCast!int
Comment #3 by github-bugzilla — 2016-01-03T14:14:48Z
Commits pushed to stable at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/9bb4da24561171cf96ea4ca5f090c3be0513653b fix Issue 15212 - BigInt should implement opCast!long and opCast!int https://github.com/D-Programming-Language/phobos/commit/06506e407aeb83d569f0a7e01ca54c45920f957c Merge pull request #3725 from CyberShadow/pull-20151017-003315