raker@lemmy.world to Programmer Humor@lemmy.mlEnglish · 1 年前Omnilingualismlemmy.worldimagemessage-square42fedilinkarrow-up1858arrow-down121
arrow-up1837arrow-down1imageOmnilingualismlemmy.worldraker@lemmy.world to Programmer Humor@lemmy.mlEnglish · 1 年前message-square42fedilink
minus-squareJakenVeina@lemm.eelinkfedilinkEnglisharrow-up22·1 年前I think templates is what he’s making fun of.
minus-squareValmond@lemmy.worldlinkfedilinkEnglisharrow-up6·1 年前How so, templates make for less code usually? Or like template meta prog? I’m a C++ dev and I’m lost on this one :-p plz send help
minus-squarePhrodo_00@kbin.sociallinkfedilinkarrow-up3·1 年前I think it’s because each template specialization works kind of like a new copy of a class.
minus-squareValmond@lemmy.worldlinkfedilinkarrow-up1·1 年前Still not getting it, I mean you don’t even get to see the code? IDK
minus-squareJakenVeina@lemm.eelinkfedilinkEnglisharrow-up1·1 年前/shrug That’s my best guess, in the sense that that’s what the compiler ends up producing, for templated code: the same code copy-pasted for however many different use cases you have.
I think templates is what he’s making fun of.
How so, templates make for less code usually? Or like template meta prog?
I’m a C++ dev and I’m lost on this one :-p plz send help
I think it’s because each template specialization works kind of like a new copy of a class.
Still not getting it, I mean you don’t even get to see the code? IDK
/shrug
That’s my best guess, in the sense that that’s what the compiler ends up producing, for templated code: the same code copy-pasted for however many different use cases you have.