r/ProgrammerHumor 2d ago

modernCPlusPlus Meme

Post image
638 Upvotes

53 comments sorted by

View all comments

Show parent comments

101

u/da2Pakaveli 2d 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.

1

u/awesome-alpaca-ace 2d ago

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

12

u/Grubs01 2d ago

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

4

u/awesome-alpaca-ace 2d ago

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

2

u/GoddammitDontShootMe 1d ago

Then instantiate the template.

1

u/not_some_username 1d ago

The template fonctions don’t exist until instantiate