@cm0002@lemmy.world to Programmer Humor@programming.dev • 5 days agoTell me the truth ...piefed.jeena.netimagemessage-square151fedilinkarrow-up11.17Karrow-down117
arrow-up11.16Karrow-down1imageTell me the truth ...piefed.jeena.net@cm0002@lemmy.world to Programmer Humor@programming.dev • 5 days agomessage-square151fedilink
minus-square@ethancedwards8@programming.devlinkfedilinkEnglish7•4 days agoWhy is this a big mistake? I’m not a c++ person
minus-square@bitcrafter@programming.devlinkfedilink5•4 days agoThe mistake was that they created a type that behaves like an array in every case except for bool, for which they created a special magical version that behaves just subtly different enough that it can break things in confusing ways.
minus-square@ethancedwards8@programming.devlinkfedilinkEnglish2•4 days agoCould you provide an example?
minus-square@timhh@programming.devlinkfedilink1•3 hours agoThe biggest problem is that each element doesn’t have a unique memory address; iterators aren’t just pointers.
Why is this a big mistake? I’m not a c++ person
The mistake was that they created a type that behaves like an array in every case except for
bool
, for which they created a special magical version that behaves just subtly different enough that it can break things in confusing ways.Could you provide an example?
The biggest problem is that each element doesn’t have a unique memory address; iterators aren’t just pointers.