On type functions

Stefan Koch uplink.coder at googlemail.com
Sun May 3 21:22:19 UTC 2020


On Sunday, 3 May 2020 at 21:14:43 UTC, Max Samukha wrote:
> On Sunday, 3 May 2020 at 09:35:34 UTC, Stefan Koch wrote:
>
>> [...]
>
> Cool! Does it mean the following will work?
>
> alias[] map(alias f, alias[] a) {
>    alias[] r;
>    foreach (e; a)
>        r ~= f!e; // can we?
>    return r;
> }
>
> enum isType(alias a) = is(a);
>
> static assert([map!(isType, AliasSeq!(1, int, "meh"))] == 
> [false, true, false]);

Yes that's what it means!


More information about the Digitalmars-d mailing list