Nothrow std.conv.to with explicit default value

Jonathan M Davis newsgroup.d at jmdavisprog.com
Wed Jun 20 09:56:15 UTC 2018


On Wednesday, June 20, 2018 09:37:00 Per Nordlöw via Digitalmars-d-learn 
wrote:
> On Wednesday, 20 June 2018 at 09:27:14 UTC, Per Nordlöw wrote:
> > On Monday, 18 June 2018 at 21:10:03 UTC, Steven Schveighoffer
> >
> > wrote:
> >> It just means re-doing std.conv.to, which is pretty hairy, but
> >> also pretty well-organized.
> >
> > Ok. Where in std.conv do the string-to-enum conversions take
> > place?
>
> AFAICT, string-to-enum-conversion must include a switch
> containing a static foreach over all the enumerators, right?

If you want to know where std.conv deals with converting enums, look for
EnumMembers, since that's the trait to get all of the members of an enum.

- Jonathan M Davis




More information about the Digitalmars-d-learn mailing list