TypeFunction example: ImplictConvTargets

Stefan Koch uplink.coder at googlemail.com
Mon Oct 5 12:56:49 UTC 2020


On Monday, 5 October 2020 at 12:46:29 UTC, jmh530 wrote:
> On Monday, 5 October 2020 at 11:44:34 UTC, Stefan Koch wrote:
>> Hi,
>>
>> [snip]
>>
>> I leave it up to you to decide which version is more 
>> understandable and extendable (should we ever get another 
>> basic type :))
>>
>> As noted previously please do discuss!
>> Maybe you like the template version more?
>> Let me know.
>
>
> It would be useful if these examples also include some kind of 
> performance information as well.
>
> Further, as far as I could tell from the previous thread, there 
> were three potential approaches: type functions, templates, and 
> reification.

Well type function _are_ transparent type reification. With nice 
syntax, that mirrors the one that's used in the rest of the 
language to query types.

As for the approach of explicitly reifying types using templates 
perhaps Andrei could present the example.
(A complete example please, that compiles standalone without 
importing a library.)




More information about the Digitalmars-d mailing list