Bug 10680 – BigInt uses deprecated std.traits.unsigned

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-20T07:58:00Z
Last change time
2013-07-21T06:56:48Z
Keywords
pull
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-07-20T07:58:34Z
I think unsigned() is a trait, so it should be in std.traits. But in the meantime there is this small problem: import std.bigint: BigInt; void main() { BigInt(1); } DMD 2.064alpha gives: ...\dmd2\src\phobos\std\bigint.d(534): Deprecation: alias std.traits.unsigned is deprecated - unsigned has been moved to std.conv. Please adjust your imports accordingly.
Comment #1 by issues.dlang — 2013-07-20T11:58:03Z
Traits are eponymous templates which tell you a trait of a type or symbol - i.e. give you some kind of information about it. unsigned does nothing of the sort. It's a function which casts to the unsigned version of an integral type. It's a conversion function and as such makes perfect sense in std.conv. It was discussed when the pull for that was made, and the decision was made to move it into std.conv, because it fits better there.
Comment #2 by issues.dlang — 2013-07-20T11:58:29Z
Comment #3 by bearophile_hugs — 2013-07-20T12:15:37Z
(In reply to comment #1) > Traits are eponymous templates which tell you a trait of a type or symbol - > i.e. give you some kind of information about it. unsigned does nothing of the > sort. It's a function which casts to the unsigned version of an integral type. > It's a conversion function and as such makes perfect sense in std.conv. It was > discussed when the pull for that was made, and the decision was made to move it > into std.conv, because it fits better there. Right, thank you.
Comment #4 by github-bugzilla — 2013-07-21T05:40:12Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/668087adb71c51637371967ee43a066cfdfafc83 Fix for issue# 10680. unsigned was moved to std.conv (with a deprecated alias left in std.traits), but std.bigint was not updated accordingly. This fixes that. https://github.com/D-Programming-Language/phobos/commit/4e9063b9599f206667224f6baf705b0644bb1701 Merge pull request #1427 from jmdavis/10680 Fix for issue# 10680.