TypeFunction example: ImplictConvTargets

Stefan Koch uplink.coder at googlemail.com
Mon Oct 5 20:57:04 UTC 2020


On Monday, 5 October 2020 at 12:50:39 UTC, Andrei Alexandrescu 
wrote:

> The existing implementation is ancient (e.g. predates std.meta) 
> and certainly deserves a redoing with Filter, which turns it 
> into a 3-liner (untested):
>
> alias Integrals = AliasSeq!(byte, ubyte, short, ushort, int, 
> uint, long, ulong, CentTypeList, float, double, real, char, 
> wchar, dchar);
> alias convertsTo(U) = is(T : U);
> alias ImplicitConversionTargets(T) = Filter!(convertsTo, 
> Integrals);

This code does not work.
I don't even need to compile it to see that.



More information about the Digitalmars-d mailing list