TypeFunction example creatiing a conversion matrix

Stefan Koch uplink.coder at gmail.com
Fri Oct 2 10:51:06 UTC 2020


On Friday, 2 October 2020 at 09:51:10 UTC, Walter Bright wrote:
> On 10/1/2020 7:27 PM, Andrei Alexandrescu wrote:
>> auto makeConvMatrix(Ts...)() {
>>      bool[T.length[T.length] result;
>>      static foreach (i, T : Ts)
>>          static foreach (j, U : Ts)
>>              result[i][j] = is(T : U);
>>      return result;
>> }
>
> This piece of code may be useful in re-implementing 
> std.meta.MostDerived.

Doesn't seem like it.
The code results in a parser error.



More information about the Digitalmars-d mailing list