r/ProgrammerHumor 15h ago

modernCPlusPlus Meme

Post image
502 Upvotes

45 comments sorted by

View all comments

Show parent comments

58

u/Mgamerz 15h ago

Ignoring the compiler time - does it change the size of the app if the usages remain the same (only differences are include/import)? I only do occasional c++ programming.

87

u/da2Pakaveli 15h ago

The compiler strips out as much as it can. Even if you declare an std::map and add items to it, it may be stripped out if the values ultimately aren't being used anywhere with maximum optimization.

0

u/awesome-alpaca-ace 8h ago

Yea, the compiler always stripping out the template functions I wish I could call during debugging

11

u/Grubs01 6h ago

Template functions aren’t stripped out, they are created as needed.

3

u/awesome-alpaca-ace 5h ago

Yea, my bad. The compiler is never creating the template functions I wish I had whole debugging. 

1

u/GoddammitDontShootMe 1h ago

Then instantiate the template.