TypeFunction example creatiing a conversion matrix
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.com
Thu Oct 1 18:33:51 UTC 2020
On 10/1/20 2:19 PM, H. S. Teoh wrote:
> On Thu, Oct 01, 2020 at 05:55:17PM +0000, Stefan Koch via Digitalmars-d wrote:
> [...]
>> Please show me in the code where is(T : U) is used.
>> I don't find it in std variant.
>
> That's because it doesn't work.
>
> We would like to be able to do this:
>
> Variant v;
> v = 100; // v now stores an int
> long l = v.get!long; // currently does not work
It actually should. ImplicitConversionTargets does cover numerics pretty
well.
More information about the Digitalmars-d
mailing list