template statistics

Adam D. Ruppe destructionator at gmail.com
Wed Jun 3 02:41:45 UTC 2020


On Wednesday, 3 June 2020 at 02:32:54 UTC, Walter Bright wrote:
>       46       38   MAKEINTRESOURCE_T(ushort i)

This is a ported C macro in the Windows headers; a fixed cost (as 
in it won't grow with your program).

But it also doesn't have to exist - it could just be a CTFE 
function, or even just written out inline (all it does is cast a 
value to a different type!)


>       38        0   OldAlias(T) if (!isAggregateType!T || 
> is(Unqual!T == T))

Now this one is a private template inside std.traits and I 
honestly don't understand why it exists. I suspect it was to 
paper over a compiler bug in the past and probably is now just 
unchanged out of fear of breakage.


Most the rest are reflection helpers in Phobos, many of which 
could prolly be trivially replaced with inline checks but .... 
maybe not a big deal anyway. idk.


More information about the Digitalmars-d mailing list