Bug 4120 – bigint implicit cast too bool

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-04-24T15:49:00Z
Last change time
2015-06-09T05:13:49Z
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-04-24T15:49:39Z
I'd like this code to work: import std.bigint: BigInt; void main() { BigInt b = 1; if (b) int r = 10; } With an opCast(bool).
Comment #1 by safety0ff.bugz — 2013-03-31T16:02:05Z
Comment #2 by adamsibson — 2013-03-31T16:40:56Z
I too would very much like to see this change, bigints have improved recently (I think?) but are still too much of a second class citizen and often don't work with templates where they could for reasons like this.
Comment #3 by github-bugzilla — 2013-04-03T07:11:22Z