template statistics

Stefan Koch uplink.coder at googlemail.com
Sat Jun 6 14:21:07 UTC 2020


On Saturday, 6 June 2020 at 13:59:38 UTC, Jean-Louis Leroy wrote:
> On Saturday, 6 June 2020 at 13:23:38 UTC, Stefan Koch wrote:
>> [...]
>
> I suspected something like this.
>
> I am trying to aggregate the template stats across several 
> translation units (in fact the test suite of openmethods), to 
> measure whether an implementation is better or worse than 
> another of the same thing. In your example, what happens if I 
> make a copy of X, name it Z, but leave the body unchanged? I 
> won't be able to distinguish the X.Ys from the Z.Ys. Even 
> within the same template, imagine I put different definitions 
> of Y inside a `static if else`. I could not tell how many times 
> each was used. So maybe template stats should display the fully 
> qualified name (including the module) along with the line and 
> column numbers.
>
> Maybe I'm missing something, I will try to find time to 
> experiment more during the week-end.

Adding the location is a good idea.
I am going to open a PR.
Fully qualified names however can absolutely gigantic for 
pathological cases, and I'd like to avoid that.


More information about the Digitalmars-d mailing list