On type functions
Max Samukha
maxsamukha at gmail.com
Sun May 3 22:43:15 UTC 2020
On Sunday, 3 May 2020 at 21:22:19 UTC, Stefan Koch wrote:
> 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!
If you can pull that off, it will be amazing.
More information about the Digitalmars-d
mailing list