Bug 15554 – typedef standard type can't be used with to! properly

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-01-11T12:30:24Z
Last change time
2024-12-01T16:25:45Z
Assigned to
No Owner
Creator
gruen_tobias
Moved to GitHub: phobos#9671 →

Comments

Comment #0 by gruen_tobias — 2016-01-11T12:30:24Z
Casting from a string to a custom Typedef type is more complicated than it should be. To should actually care about the underlying typedef-type, and recognize that it has to parse a string to a long value: alias QuestionId = Typedef!(long, long.init, "QuestionId"); QuestionId q = to!(TypedefType!QuestionId)("43"); // Compiles QuestionId q2 = to!QuestionId("43"); // Error.. Forum: http://forum.dlang.org/thread/[email protected] togrue
Comment #1 by robert.schadek — 2024-12-01T16:25:45Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9671 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB