TypeFunction example creatiing a conversion matrix

Stefan Koch uplink.coder at gmail.com
Thu Oct 1 09:33:28 UTC 2020


On Thursday, 1 October 2020 at 09:28:34 UTC, Stefan Koch wrote:
> On Thursday, 1 October 2020 at 08:57:12 UTC, Stefan Koch wrote:
>
> Let me illustrate the user visible diffrence:
> type function:
> string makeConvMatrix(alias[] types ...)  // 0.245 times the 
> size of template object file
> Included symbols (extracted with nm)
> 0000000000000000 R _D14makeConvMatrix12__ModuleInfoZ
>                  U _d_dso_registry
>                  U __start_minfo
>                  U __stop_minfo
>
> template:
> string makeConvMatrix(types ...)()        // 4 times the size 
> of typefunction object file
> included symbols (extracted with nm)
>                  U _D12TypeInfo_Aya6__initZ
> 0000000000000000 R _D14makeConvMatrix12__ModuleInfoZ
> 0000000000000000 W 
> _D14makeConvMatrix__TQtTgThTsTtTiTkTlTmZQBmFNaNbNfZAya
>                  U _d_arrayappendT

And btw the fact that you don't see U _d_arrayappendT in the 
imported symbols of the type function ... means it works with 
-betterC!


More information about the Digitalmars-d mailing list