Using std.conv.to with std.typecons.Typedef

Tobi G. via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jan 11 04:01:30 PST 2016


On Monday, 11 January 2016 at 08:03:19 UTC, Saurabh Das wrote:
>
> How can I get std.conv to understand std.typecons.Typedef?

You can do something like this:

QuestionId q = to!(TypedefType!QuestionId)("43");

> In general, is there a better solution to orthogonal types than 
> Typedef?

Typedef is a reasonably solution, for this in my opinion.

togrue



More information about the Digitalmars-d-learn mailing list