cm0002@lemmy.world to Programmer Humor@programming.dev · 4 months agoTell me the truth ...piefed.jeena.netimagemessage-square167linkfedilinkarrow-up1986arrow-down115
arrow-up1971arrow-down1imageTell me the truth ...piefed.jeena.netcm0002@lemmy.world to Programmer Humor@programming.dev · 4 months agomessage-square167linkfedilink
minus-squareethancedwards8@programming.devlinkfedilinkEnglisharrow-up7·4 months agoWhy is this a big mistake? I’m not a c++ person
minus-squarebitcrafter@programming.devlinkfedilinkarrow-up5·4 months 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-squareethancedwards8@programming.devlinkfedilinkEnglisharrow-up2arrow-down1·4 months agoCould you provide an example?
minus-squaretimhh@programming.devlinkfedilinkarrow-up1·3 months 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.