On type functions

Stefan Koch uplink.coder at googlemail.com
Sun May 3 11:16:21 UTC 2020


On Sunday, 3 May 2020 at 11:11:03 UTC, Stefan Koch wrote:
>
> struct from spec is exactly one of the things that will not be 
> possible without wrapping it in a template.
>
> template structFromString(string spec)
> {
>     alias structFromStringTypeFn(string spec)
>     {
>         ...
>     }
>     alias = structFromString = structFromStringTypeFn!(spec);
> }
> that looks a bit strange but it allows me to not have to worry 
> about certain constraints that I would otherwise have to worry 
> about.

actually I typed the example out wrong.
it's not a good day :-/


More information about the Digitalmars-d mailing list