C++: How do I work out the usage count of a function template?

1    21 Nov 2017 13:48 by u/skruf

Purely out of curiosity, I wonder how many times the compiler used a given function template to make a function. Is this possible?

I couldn't find anything using the search engines I utilize, so... any wizards here?

7 comments

0

I can't program in D.

1

So you're saying this isn't really possible in C++ ?

0

No, you typed C but then you added ++ incrementing it to D. I only know C, not D.

1

facepalm I'm kinda slow on taking jokes. but yeah fair enough lol

0

You weren't in joke mode. I get it. I'm just being a smart ass.

0

If you can read the object file that is created upon compilation, you should be able to see exactly what's going into the binaries. That'll tell you exactly what's going on in your code, which functions are being called, and how they're being used

0

Don't know why I did not think of this myself... well, thank you for the tip!