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

          Issue ID: 15554
           Summary: typedef standard type can't be used with to! properly
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nob...@puremagic.com
          Reporter: gruen_tob...@web.de

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/otcbczxfxzannjcok...@forum.dlang.org


togrue

--

Reply via email to